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

cmd/compile: inconsistent acceptance of cyclic variable declaration (esoteric) #25677

Open
griesemer opened this issue Jun 1, 2018 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@griesemer
Copy link
Contributor

Another test case for handling of cycle detection:
https://play.golang.org/p/DAftfsYBsrX
is accepted and appears to run correctly. The similar (and functionally identical) program
https://play.golang.org/p/AChHOplAHzp
is not accepted with an incorrect type alias cycle error. And the simplified version eliminating the type name T
https://play.golang.org/p/ozYsLzyDax8
is not accepted with a type checking loop error.

Yet all of them are functionally the same. Either all of them should be accepted or none of them should be accepted.

@griesemer griesemer added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 1, 2018
@griesemer griesemer added this to the Unplanned milestone Jun 1, 2018
@griesemer griesemer self-assigned this Jun 1, 2018
@griesemer
Copy link
Contributor Author

For reference: gccgo accepts and runs the first two versions. It crashes with the 3rd version (issue #25679).

@zigo101
Copy link

zigo101 commented Jun 1, 2018

some related? #23823

@griesemer
Copy link
Contributor Author

@go101 Related in the sense that there are cycles. But there may be different code paths executed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants