don't crash on certain undefined symbols, give proper error instead

Also the error handlers in unit tests now de-duplicate messages just like the compiler itself does
This commit is contained in:
Irmen de Jong
2023-03-11 14:55:13 +01:00
parent 4600772e05
commit d76547ead4
12 changed files with 90 additions and 27 deletions
+6 -2
View File
@@ -32,11 +32,15 @@ internal class ErrorReporterForTests(private val throwExceptionAtReportIfErrors:
val warnings = mutableListOf<String>()
override fun err(msg: String, position: Position) {
errors.add("${position.toClickableStr()} $msg")
val text = "${position.toClickableStr()} $msg"
if(text !in errors)
errors.add(text)
}
override fun warn(msg: String, position: Position) {
warnings.add("${position.toClickableStr()} $msg")
val text = "${position.toClickableStr()} $msg"
if(text !in warnings)
warnings.add(text)
}
override fun noErrors(): Boolean = errors.isEmpty()