diff --git a/go/types/eval.go b/go/types/eval.go index 7b42ff1a..c09f2a3b 100644 --- a/go/types/eval.go +++ b/go/types/eval.go @@ -65,7 +65,11 @@ func Eval(fset *token.FileSet, pkg *Package, pos token.Pos, expr string) (tv Typ } // parse expressions - node, err := parser.ParseExprFrom(fset, "eval", expr, 0) + // BUG(gri) In case of type-checking errors below, the type checker + // doesn't have the correct file set for expr. The correct + // solution requires a ParseExpr that uses the incoming + // file set fset. + node, err := parser.ParseExpr(expr) if err != nil { return TypeAndValue{}, err }