mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Allow type parameters on alias types
This commit is contained in:
@@ -475,12 +475,12 @@ func extractObjects(tw *trap.Writer, scope *types.Scope, scopeLabel trap.Label)
|
||||
populateTypeParamParents(funcObj.Type().(*types.Signature).TypeParams(), obj)
|
||||
populateTypeParamParents(funcObj.Type().(*types.Signature).RecvTypeParams(), obj)
|
||||
}
|
||||
// Populate type parameter parents for named types. Note that we
|
||||
// skip type aliases as the original type should be the parent
|
||||
// of any type parameters.
|
||||
if typeNameObj, ok := obj.(*types.TypeName); ok && !typeNameObj.IsAlias() {
|
||||
// Populate type parameter parents for named types.
|
||||
if typeNameObj, ok := obj.(*types.TypeName); ok {
|
||||
if tp, ok := typeNameObj.Type().(*types.Named); ok {
|
||||
populateTypeParamParents(tp.TypeParams(), obj)
|
||||
} else if tp, ok := typeNameObj.Type().(*types.Alias); ok {
|
||||
populateTypeParamParents(tp.TypeParams(), obj)
|
||||
}
|
||||
}
|
||||
extractObject(tw, obj, lbl)
|
||||
|
||||
Reference in New Issue
Block a user