]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] go/types: remove unnecessary guard from NewInterfaceType
authorRob Findley <rfindley@google.com>
Fri, 16 Jul 2021 18:54:21 +0000 (14:54 -0400)
committerRobert Findley <rfindley@google.com>
Mon, 19 Jul 2021 15:50:21 +0000 (15:50 +0000)
This is a partial port of CL 322609, containing only changes to
go/types. Importer changes will be made in a separate CL.

Change-Id: I50af3c1ed5e949bb28a3462d717c0eb29a5f31ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/335144
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/interface.go

index 91270cfcd37c3fef8bb2bb6405a6c4bef78a047c..686dd7a786dcfcaae945634c3439f6950eeee0e3 100644 (file)
@@ -72,17 +72,6 @@ func NewInterfaceType(methods []*Func, embeddeds []Type) *Interface {
                }
        }
 
-       // TODO(rfindley): this guard is not present in types2. Remove it?
-       // All embedded types should be interfaces; however, defined types
-       // may not yet be fully resolved. Only verify that non-defined types
-       // are interfaces. This matches the behavior of the code before the
-       // fix for #25301 (issue #25596).
-       for _, t := range embeddeds {
-               if _, ok := t.(*Named); !ok && !IsInterface(t) {
-                       panic("embedded type is not an interface")
-               }
-       }
-
        // sort for API stability
        sortMethods(methods)