diff --git a/src/cmd/compile/internal/types2/issues_test.go b/src/cmd/compile/internal/types2/issues_test.go index ba7cefb892..a36b832f04 100644 --- a/src/cmd/compile/internal/types2/issues_test.go +++ b/src/cmd/compile/internal/types2/issues_test.go @@ -1,4 +1,3 @@ -// UNREVIEWED // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -29,7 +28,6 @@ func mustParse(t *testing.T, src string) *syntax.File { func TestIssue5770(t *testing.T) { f := mustParse(t, `package p; type S struct{T}`) var conf Config - // conf := Config{Importer: importer.Default()} _, err := conf.Check(f.PkgName.Value, []*syntax.File{f}, nil) // do not crash want := "undeclared name: T" if err == nil || !strings.Contains(err.Error(), want) { @@ -76,7 +74,7 @@ var ( } case *syntax.Name: if x.Value == "nil" { - want = NewInterfaceType(nil, nil) // interface{} + want = NewInterfaceType(nil, nil) // interface{} (for now, go/types types this as "untyped nil") } } if want != nil && !Identical(tv.Type, want) { @@ -387,9 +385,6 @@ func TestIssue28005(t *testing.T) { t.Fatal("object X not found") } iface := obj.Type().Underlying().(*Interface) // object X must be an interface - if iface == nil { - t.Fatalf("%s is not an interface", obj) - } // Each iface method m is embedded; and m's receiver base type name // must match the method's name per the choice in the source file. @@ -529,22 +524,22 @@ func TestIssue34921(t *testing.T) { func TestIssue43088(t *testing.T) { // type T1 struct { - // x T2 + // _ T2 // } // // type T2 struct { - // x struct { - // x T2 + // _ struct { + // _ T2 // } // } n1 := NewTypeName(syntax.Pos{}, nil, "T1", nil) T1 := NewNamed(n1, nil, nil) n2 := NewTypeName(syntax.Pos{}, nil, "T2", nil) T2 := NewNamed(n2, nil, nil) - s1 := NewStruct([]*Var{NewField(syntax.Pos{}, nil, "x", T2, false)}, nil) + s1 := NewStruct([]*Var{NewField(syntax.Pos{}, nil, "_", T2, false)}, nil) T1.SetUnderlying(s1) - s2 := NewStruct([]*Var{NewField(syntax.Pos{}, nil, "x", T2, false)}, nil) - s3 := NewStruct([]*Var{NewField(syntax.Pos{}, nil, "x", s2, false)}, nil) + s2 := NewStruct([]*Var{NewField(syntax.Pos{}, nil, "_", T2, false)}, nil) + s3 := NewStruct([]*Var{NewField(syntax.Pos{}, nil, "_", s2, false)}, nil) T2.SetUnderlying(s3) // These calls must terminate (no endless recursion).