feat: show expected and got types for TypeMismatch

This commit is contained in:
Gleb Koval 2025-02-07 14:16:20 +00:00
parent c547a2a37f
commit 68e4762b37
Signed by: cyclane
GPG Key ID: 15E168A8B332382C

View File

@ -35,7 +35,7 @@ def printError(error: Error)(using errorContent: String): Unit = {
highlight(pos, 1) highlight(pos, 1)
case Error.TypeMismatch(pos, expected, got, msg) => case Error.TypeMismatch(pos, expected, got, msg) =>
printPosition(pos) printPosition(pos)
println(msg) println(s"Type mismatch: $msg\nExpected: $expected\nGot: $got")
highlight(pos, 1) highlight(pos, 1)
case Error.SemanticError(pos, msg) => case Error.SemanticError(pos, msg) =>
printPosition(pos) printPosition(pos)