-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go: 1.24 support - Tolerate type parameters on alias types #18585
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.