1
0
mirror of https://github.com/golang/go synced 2024-10-01 08:18:32 -06:00

go/pointer: fix build (provide correct args to types.NewSignature and types.Eval)

TBR: adonovan

Change-Id: I4b43b566278ede6b780a59f986c0fc392a5ef4ac
Reviewed-on: https://go-review.googlesource.com/11041
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Robert Griesemer 2015-06-12 18:07:02 -07:00
parent f389b29208
commit e5c3ebe4c7
2 changed files with 2 additions and 11 deletions

View File

@ -12,7 +12,6 @@ import (
"bytes"
"errors"
"fmt"
"go/parser"
"go/token"
"io/ioutil"
"os"
@ -240,15 +239,7 @@ func doOneInput(input, filename string) bool {
for _, typstr := range split(rest, "|") {
var t types.Type = types.Typ[types.Invalid] // means "..."
if typstr != "..." {
texpr, err := parser.ParseExpr(typstr)
if err != nil {
ok = false
// Don't print err since its location is bad.
e.errorf("'%s' is not a valid type", typstr)
continue
}
mainFileScope := mainpkg.Object.Scope().Child(0)
tv, err := types.EvalNode(prog.Fset, texpr, mainpkg.Object, mainFileScope)
tv, err := types.Eval(prog.Fset, mainpkg.Object, f.Pos(), typstr)
if err != nil {
ok = false
// Don't print err since its location is bad.

View File

@ -1849,7 +1849,7 @@ func changeRecv(sig *types.Signature) *types.Signature {
for i := 0; i < n; i++ {
p2[i+1] = params.At(i)
}
return types.NewSignature(nil, nil, types.NewTuple(p2...), sig.Results(), sig.Variadic())
return types.NewSignature(nil, types.NewTuple(p2...), sig.Results(), sig.Variadic())
}
func (c *rtypeMethodByNameConstraint) solve(a *analysis, delta *nodeset) {