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:
Robert Griesemer 2017-11-29 21:28:37 -08:00
parent 36c7af3342
commit 04447353bc
2 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -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)