diff --git a/go/extractor/extractor.go b/go/extractor/extractor.go index 81e7e99dee54..f372cc161805 100644 --- a/go/extractor/extractor.go +++ b/go/extractor/extractor.go @@ -1618,6 +1618,9 @@ func extractType(tw *trap.Writer, tp types.Type) trap.Label { case *types.Interface: kind = dbscheme.InterfaceType.Index() for i := 0; i < tp.NumMethods(); i++ { + // Note that methods coming from embedded interfaces can be + // accessed through `Method(i)`, so there is no need to + // deal with them separately. meth := tp.Method(i) // Note that methods do not have a parent scope, so they are diff --git a/go/ql/lib/semmle/go/Types.qll b/go/ql/lib/semmle/go/Types.qll index 6f0defead24b..f7bb6afe3d7a 100644 --- a/go/ql/lib/semmle/go/Types.qll +++ b/go/ql/lib/semmle/go/Types.qll @@ -742,7 +742,8 @@ class InterfaceType extends @interfacetype, CompositeType { /** Gets the type of method `name` of this interface type. */ Type getMethodType(string name) { // Note that negative indices correspond to embedded interfaces and type - // set literals. + // set literals. Note also that methods coming from embedded interfaces + // have already been included in `component_types`. exists(int i | i >= 0 | component_types(this, i, name, result)) }