go/ssa: complete interface types for correct string form (fix build)
Fixes golang/go#22933. Change-Id: I0cf0aab8b77114ee7eb1e181aee2c5b75087aa83 Reviewed-on: https://go-review.googlesource.com/80897 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
36c7af3342
commit
04447353bc
|
@ -47,6 +47,11 @@ func TestTypeParser(t *testing.T) {
|
|||
t.Errorf("expected full parse, stopped at %q", p.lit)
|
||||
}
|
||||
|
||||
// interfaces must be explicitly completed
|
||||
if ityp, _ := typ.(*types.Interface); ityp != nil {
|
||||
ityp.Complete()
|
||||
}
|
||||
|
||||
got := typ.String()
|
||||
if got != test.want {
|
||||
t.Errorf("got type %q, expected %q", got, test.want)
|
||||
|
|
|
@ -58,7 +58,7 @@ var (
|
|||
tString = types.Typ[types.String]
|
||||
tUntypedNil = types.Typ[types.UntypedNil]
|
||||
tRangeIter = &opaqueType{nil, "iter"} // the type of all "range" iterators
|
||||
tEface = new(types.Interface)
|
||||
tEface = types.NewInterface(nil, nil).Complete()
|
||||
|
||||
// SSA Value constants.
|
||||
vZero = intConst(0)
|
||||
|
|
Loading…
Reference in New Issue