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 {
1618
1618
case * types.Interface :
1619
1619
kind = dbscheme .InterfaceType .Index ()
1620
1620
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.
1621
1624
meth := tp .Method (i )
1622
1625
1623
1626
// 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 {
737
737
override string toString ( ) { result = "type set literal type" }
738
738
}
739
739
740
+ predicate foo ( NamedType t , string name , Type mt ) {
741
+ t .getUnderlyingType ( ) .( InterfaceType ) .getMethodType ( name ) = mt
742
+ }
743
+
740
744
/** An interface type. */
741
745
class InterfaceType extends @interfacetype, CompositeType {
742
746
/** Gets the type of method `name` of this interface type. */
743
747
Type getMethodType ( string name ) {
744
748
// 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`.
746
751
exists ( int i | i >= 0 | component_types ( this , i , name , result ) )
747
752
}
748
753
You can’t perform that action at this time.
0 commit comments