mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-01 17:47:46 +00:00
d155e31b64
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.
19 lines
325 B
Go
19 lines
325 B
Go
package compiler
|
|
|
|
import (
|
|
"go/token"
|
|
"go/types"
|
|
)
|
|
|
|
func (c *Compiler) makeError(pos token.Pos, msg string) types.Error {
|
|
return types.Error{
|
|
Fset: c.ir.Program.Fset,
|
|
Pos: pos,
|
|
Msg: msg,
|
|
}
|
|
}
|
|
|
|
func (c *Compiler) addError(pos token.Pos, msg string) {
|
|
c.diagnostics = append(c.diagnostics, c.makeError(pos, msg))
|
|
}
|