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: panic with mutual instantiation #49043

Closed
findleyr opened this issue Oct 18, 2021 · 2 comments
Closed

go/types, types2: panic with mutual instantiation #49043

findleyr opened this issue Oct 18, 2021 · 2 comments

Comments

@findleyr
Copy link
Contributor

Type checking the following code panics in the type checker in substitution:

package p

type N[P any] M[P]

type M[P any] N[P]

The reason is likely that RHS expansion happens too early, in Checker.typeDecl. I believe this can be fixed by delaying expansion, but filing an issue to track this as a release-blocker since it is late in the cycle.

CC @griesemer

@findleyr findleyr added this to the Go1.18 milestone Oct 18, 2021
@findleyr findleyr self-assigned this Oct 18, 2021
@gopherbot
Copy link

Change https://golang.org/cl/356533 mentions this issue: go/types: delay expansion of underlying in typeDecl

@gopherbot
Copy link

Change https://golang.org/cl/356517 mentions this issue: cmd/compile/internal/types2: delay expansion of underlying in typeDecl

gopherbot pushed a commit that referenced this issue Oct 19, 2021
This is a clean port of CL 356533 from go/types to types2.

Fixes #49043.

Change-Id: If389b94ece28042b0c8b436959dd21f26147a144
Reviewed-on: https://go-review.googlesource.com/c/go/+/356517
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants