diff --git a/src/cmd/compile/internal/syntax/parser.go b/src/cmd/compile/internal/syntax/parser.go index ee63a751c8..13df653106 100644 --- a/src/cmd/compile/internal/syntax/parser.go +++ b/src/cmd/compile/internal/syntax/parser.go @@ -1370,13 +1370,13 @@ func (p *parser) interfaceType() *InterfaceType { f.pos = p.pos() f.Name = type_ f.Type = p.type_(true) - typ.MethodList = append(typ.MethodList, &Field{}) + typ.MethodList = append(typ.MethodList, f) for p.got(_Comma) { f := new(Field) f.pos = p.pos() f.Name = type_ f.Type = p.type_(true) - typ.MethodList = append(typ.MethodList, &Field{}) + typ.MethodList = append(typ.MethodList, f) } } diff --git a/src/cmd/compile/internal/types2/testdata/tmp.go2 b/src/cmd/compile/internal/types2/testdata/tmp.go2 index 4873be104d..74088705dd 100644 --- a/src/cmd/compile/internal/types2/testdata/tmp.go2 +++ b/src/cmd/compile/internal/types2/testdata/tmp.go2 @@ -1,25 +1,3 @@ package p -type B(type P) interface{} - -func _f(type P B)() {} - -// These are only ok if AcceptContracts = false. -// (The comparable contract cannot be embedded in Bound.) -/* -func _(type T comparable)(x, y T) bool { - return x == y || x != y -} - -type Bound interface { - comparable -} - -func _(type T Bound)(x, y T) bool { - return x == y || x != y -} - -func _(type A, B Bound)(a1, a2 A, b1, b2 B) bool { - return a1 == a2 || b1 != b2 -} -*/ +type T interface{type int} \ No newline at end of file diff --git a/src/cmd/compile/internal/types2/typestring_test.go b/src/cmd/compile/internal/types2/typestring_test.go index 04b05543f7..5514426371 100644 --- a/src/cmd/compile/internal/types2/typestring_test.go +++ b/src/cmd/compile/internal/types2/typestring_test.go @@ -15,7 +15,6 @@ import ( const filename = "" func makePkg(src string) (*Package, error) { - //file, err := parser.ParseFile(fset, filename, src, parser.DeclarationErrors) file, err := parseSrc(filename, src) if err != nil { return nil, err @@ -92,7 +91,7 @@ var independentTestTypes = []testEntry{ dup("interface{}"), dup("interface{m()}"), dup(`interface{String() string; m(int) float32}`), - // dup(`interface{type int, float32, complex128}`), // TODO(gri) fix this + dup(`interface{type int, float32, complex128}`), // maps dup("map[string]int"),