mirror of
https://github.com/golang/go
synced 2024-11-18 23:54:41 -07: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:
parent
f389b29208
commit
e5c3ebe4c7
@ -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.
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user