-
Notifications
You must be signed in to change notification settings - Fork 18k
go/parser: uses of function type params are not resolved in the signature #45221
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
Comments
Change https://golang.org/cl/304456 mentions this issue: |
Change https://golang.org/cl/304453 mentions this issue: |
/cc @@griesemer |
For #45104 For #45221 Change-Id: I8966555f4e8844d5b6766d00d48f7a81868ccf40 Reviewed-on: https://go-review.googlesource.com/c/go/+/304453 Trust: Robert Findley <[email protected]> Trust: Robert Griesemer <[email protected]> Run-TryBot: Robert Findley <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
Type parameter resolution is a bit tricky: type parameters are in the function scope, but unlike ordinary parameters may reference eachother. When resolving the function scope, we must be careful about the order in which objects are resolved and declared. Using ordering allows us to avoid passing around temporary scopes for field declarations. Add a bunch of tests for this behavior, and skip "_" in resolution tests as it just adds noise. For #45221 Change-Id: Id080cddce3fd76396bf86ba5aba856aedf64a458 Reviewed-on: https://go-review.googlesource.com/c/go/+/304456 Trust: Robert Findley <[email protected]> Trust: Robert Griesemer <[email protected]> Run-TryBot: Robert Findley <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
@findleyr This is in the 1.18 milestone. Did it get fixed? Or should it move to 1.19? Thanks. |
Yes, this is done now. There is one remaining issue, which we can track with #50956. |
go/parser object resolution correctly resolves type parameters within type declarations, but not within function declarations. For example, none of the uses of T in the below snippet are resolved (correction: the T in
var t T
is resolved, but not the Ts in the signature):This is minor, but we should probably fix it. Will do as part of #45104.
CC @griesemer
The text was updated successfully, but these errors were encountered: