mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #17941 from owen-mc/go/fix/missing-method-qualified-names
Go: fix missing qualified names for some promoted methods
This commit is contained in:
@@ -1713,13 +1713,24 @@ func extractType(tw *trap.Writer, tp types.Type) trap.Label {
|
||||
extractMethod(tw, meth)
|
||||
}
|
||||
|
||||
underlyingInterface, underlyingIsInterface := underlying.(*types.Interface)
|
||||
_, underlyingIsPointer := underlying.(*types.Pointer)
|
||||
|
||||
// associate all methods of underlying interface with this type
|
||||
if underlyingInterface, ok := underlying.(*types.Interface); ok {
|
||||
if underlyingIsInterface {
|
||||
for i := 0; i < underlyingInterface.NumMethods(); i++ {
|
||||
methlbl := extractMethod(tw, underlyingInterface.Method(i).Origin())
|
||||
dbscheme.MethodHostsTable.Emit(tw, methlbl, lbl)
|
||||
}
|
||||
}
|
||||
|
||||
// If `underlying` is not a pointer or interface then methods can
|
||||
// be defined on `origintp`. In this case we must ensure that
|
||||
// `*origintp` is in the database, so that Method.hasQualifiedName
|
||||
// correctly includes methods with receiver type `*origintp`.
|
||||
if !underlyingIsInterface && !underlyingIsPointer {
|
||||
extractType(tw, types.NewPointer(origintp))
|
||||
}
|
||||
case *types.TypeParam:
|
||||
kind = dbscheme.TypeParamType.Index()
|
||||
parentlbl := getTypeParamParentLabel(tw, tp)
|
||||
|
||||
Reference in New Issue
Block a user