Skip to content

Commit

Permalink
Merge pull request #18585 from owen-mc/go/1.24-support-prep
Browse files Browse the repository at this point in the history
Go: 1.24 support - Tolerate type parameters on alias types
  • Loading branch information
owen-mc authored Jan 27, 2025
2 parents f75ecdb + 29f6d48 commit 1bacb99
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions go/extractor/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,11 @@ 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() {
if tp, ok := typeNameObj.Type().(*types.Named); ok {
// Populate type parameter parents for named types.
if typeNameObj, ok := obj.(*types.TypeName); ok {
if tp, ok := typeNameObj.Type().(*types.Named); ok && !typeNameObj.IsAlias() {
populateTypeParamParents(tp.TypeParams(), obj)
} else if tp, ok := typeNameObj.Type().(*types.Alias); ok {
populateTypeParamParents(tp.TypeParams(), obj)
}
}
Expand Down

0 comments on commit 1bacb99

Please sign in to comment.