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

Closed
findleyr opened this issue Mar 4, 2022 · 4 comments
Closed

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

findleyr opened this issue Mar 4, 2022 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@findleyr
Copy link
Contributor

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

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 The path to resolution is known, but the work has not been done. label Mar 7, 2022
@findleyr
Copy link
Contributor Author

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 modified the milestones: Go1.18, Go1.19 Mar 7, 2022
@ianlancetaylor
Copy link
Contributor

Rolling forward to 1.20. Please comment if you disagree. Thanks.

@ianlancetaylor ianlancetaylor modified the milestones: Go1.19, Go1.20 Jun 24, 2022
@findleyr
Copy link
Contributor Author

I don't think we're ever going to add type-type inference, and if we do the mechanism will be different. So I think this is no longer relevant.

@golang golang locked and limited conversation to collaborators Jun 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
Development

No branches or pull requests

4 participants