Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don’t require a newline after a type mismatch error reported by the compiler #1165

Merged
merged 1 commit into from
Jun 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class TypecheckSpec extends Specification:
result must beFailing(startWith("""|val n: Int = 0; val s: Int = n + "hello"
| ^
|Found: String
|Required: Int
|""".stripMargin))
|Required: Int""".stripMargin))

def e3 =
def code1 = """val n: Int = "x"; """
Expand All @@ -47,15 +46,13 @@ class TypecheckSpec extends Specification:
result must beFailing(startWith("""|val n: Int = "x"; val s: Int = "y"
| ^
|Found: ("x" : String)
|Required: Int
|""".stripMargin))
|Required: Int""".stripMargin))

result match
case Failure(_, _, _, FailureDetailsMessages(messages)) =>
messages(0) must startWith("""|val n: Int = "x"; val s: Int = "y"
| ^
|Found: ("y" : String)
|Required: Int
|""".stripMargin)
|Required: Int""".stripMargin)
case other =>
failure(s"unexpected $other")