This is https://go-review.googlesource.com/10999 which we could not apply
in x/tools/go/types because we must not rely on 1.5 features in that repo
yet.
Change-Id: I9a57cdb7ad4051df278d1fbed90c736df50f426f
Reviewed-on: https://go-review.googlesource.com/11125
Reviewed-by: Alan Donovan <adonovan@google.com>
}
// parse expressions
- // 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)
+ node, err := parser.ParseExprFrom(fset, "eval", expr, 0)
if err != nil {
return TypeAndValue{}, err
}