all: improve compiler error handling

Most of these errors are actually "todo" or "unimplemented" errors, so
the return type is known. This means that compilation can proceed (with
errors) even though the output will be incorrect. This is useful because
this way, all errors in a compilation unit can be shown together to the
user.
This commit is contained in:
Ayke van Laethem
2019-04-21 16:20:25 +02:00
committed by Ron Evans
parent 45cacda7b3
commit d155e31b64
5 changed files with 65 additions and 55 deletions
+4
View File
@@ -12,3 +12,7 @@ func (c *Compiler) makeError(pos token.Pos, msg string) types.Error {
Msg: msg,
}
}
func (c *Compiler) addError(pos token.Pos, msg string) {
c.diagnostics = append(c.diagnostics, c.makeError(pos, msg))
}