Go: 1.24 support - Tolerate type parameters on alias types#18585
Go: 1.24 support - Tolerate type parameters on alias types#18585owen-mc merged 2 commits intogithub:mainfrom
Conversation
There was a problem hiding this comment.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
go/extractor/extractor.go:482
- The newly introduced code path for type aliases is not covered by tests in this PR. Consider adding tests to verify the functionality of type parameter parent population for alias types.
} else if tp, ok := typeNameObj.Type().(*types.Alias); ok {
Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more
smowton
left a comment
There was a problem hiding this comment.
Add a test case to check what the comment describes re: the proper parent of a type parameter doesn't cause trouble?
For example, I think if we had A with type param T and then type B = A, it sounds like there was a risk that T would have ambiguous parents, A and B?
|
After staring at it for a long time, I think you're right that we need more of a check for the go 1.23 situation. I think the situation is this:
As for tests:
|
|
👍 lmk when ready for re-review re adding an extra check if needed |
|
@smowton I added the extra check already in Retain previous check for alias types. I also ran DCA, which showed nothing significant. |
This is a small part of #18306 that can be merged in advance and means that the extractor won't fail on code using type paramters on type aliases, which is a new language feature in go 1.24. It is not tested in this PR as that would involve the test using 1.24, but it is tested in the original PR.