tinygo/compiler/errors.go
Ayke van Laethem da0a02d128
compiler: return error messages with source location
Replace most errors returned by the compiler (using errors.New) with an
error type that includes the source location.
2018-12-01 17:41:15 +01:00

14 строки
203 Б
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,
}
}