File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1618,6 +1618,9 @@ func extractType(tw *trap.Writer, tp types.Type) trap.Label {
16181618 case * types.Interface :
16191619 kind = dbscheme .InterfaceType .Index ()
16201620 for i := 0 ; i < tp .NumMethods (); i ++ {
1621+ // Note that methods coming from embedded interfaces can be
1622+ // accessed through `Method(i)`, so there is no need to
1623+ // deal with them separately.
16211624 meth := tp .Method (i )
16221625
16231626 // Note that methods do not have a parent scope, so they are
Original file line number Diff line number Diff line change @@ -737,12 +737,17 @@ class TypeSetLiteralType extends @typesetliteraltype, CompositeType {
737737 override string toString ( ) { result = "type set literal type" }
738738}
739739
740+ predicate foo ( NamedType t , string name , Type mt ) {
741+ t .getUnderlyingType ( ) .( InterfaceType ) .getMethodType ( name ) = mt
742+ }
743+
740744/** An interface type. */
741745class InterfaceType extends @interfacetype, CompositeType {
742746 /** Gets the type of method `name` of this interface type. */
743747 Type getMethodType ( string name ) {
744748 // Note that negative indices correspond to embedded interfaces and type
745- // set literals.
749+ // set literals. Note also that methods coming from embedded interfaces
750+ // have already been included in `component_types`.
746751 exists ( int i | i >= 0 | component_types ( this , i , name , result ) )
747752 }
748753
You can’t perform that action at this time.
0 commit comments