Skip to content
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/types, types2: missing type due to delayed type-type inference #51489

Open
findleyr opened this issue Mar 4, 2022 · 2 comments
Open

go/types, types2: missing type due to delayed type-type inference #51489

findleyr opened this issue Mar 4, 2022 · 2 comments
Labels
NeedsFix
Milestone

Comments

@findleyr
Copy link
Contributor

@findleyr findleyr commented Mar 4, 2022

This is a follow-up on #51233: in type declarations, it is possible to substitute for type arguments before they are fully resolved.

While investigating this afternoon I was able to construct another crasher:
https://go.dev/play/p/V5Jl7-WDV4K?v=gotip

This may be complicated, but the mechanism is simple: force an expansion of T before R[int] is resolved. In this case, this is forced by the call to var x = T[int]{}.F. We currently lack controls to ensure that inference happens before substitution. I am not sure whether it is trivial to introduce such a mechanism.

CC @griesemer

@findleyr findleyr added this to the Go1.18 milestone Mar 4, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented Mar 4, 2022

Change https://go.dev/cl/390040 mentions this issue: go/types: add a check to detect invalid substitution for inferred types

@cagedmantis cagedmantis added the NeedsFix label Mar 7, 2022
@findleyr
Copy link
Contributor Author

@findleyr findleyr commented Mar 7, 2022

In #51527 we have disabled type-type inference for 1.18, so this can be moved to 1.19.

@findleyr findleyr removed this from the Go1.18 milestone Mar 7, 2022
@findleyr findleyr added this to the Go1.19 milestone Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
None yet
Development

No branches or pull requests

3 participants