feat: improve semantic errors #15

Merged
gk1623 merged 5 commits from improve-semantic-errors into master 2025-02-07 15:07:36 +00:00
Showing only changes of commit 68e4762b37 - Show all commits

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)