diff --git a/compiler/parser.go b/compiler/parser.go index adea5b9..79adb63 100644 --- a/compiler/parser.go +++ b/compiler/parser.go @@ -337,7 +337,7 @@ func (p *Parser) addMethod(ti *ast.TypeInfo, f *ast.Func) error { } } - return fmt.Errorf("type %s.%s not found", p.pkg.Name, t.Name) + return p.errf(f.This.Location(), "type %s.%s not found", p.pkg.Name, t.Name) } func (p *Parser) parseGlobalVar(isConst bool,