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
Assignees
Milestone

Comments

@findleyr
Copy link
Contributor

@findleyr findleyr commented Oct 18, 2021

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

@gopherbot gopherbot commented Oct 18, 2021

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

Loading

@gopherbot gopherbot closed this in eba0e86 Oct 18, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Oct 19, 2021

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

Loading

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants