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: obscure initialization loop error message due to inlining #21750

Open
dvyukov opened this issue Sep 3, 2017 · 3 comments
Open

cmd/compile: obscure initialization loop error message due to inlining #21750

dvyukov opened this issue Sep 3, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@dvyukov
Copy link
Member

@dvyukov dvyukov commented Sep 3, 2017

go version devel +0a4913b2d4 Wed Aug 23 11:09:11 2017 +0200 linux/amd64

https://play.golang.org/p/TW5DVv3zTk

Produces obscure:

tmp/sandbox278346721/main.go:3:5: initialization loop:
	prog.go:3:5 A refers to
	prog.go:3:5 A

If compiled with -l produces understandable error message:

/tmp/test.go:3:5: initialization loop:
	/tmp/test.go:3:5 A refers to
	/tmp/test.go:7:10 B refers to
	/tmp/test.go:11:10 C refers to
	/tmp/test.go:15:10 D refers to
	/tmp/test.go:3:5 A

In real scenario this is spread across files and intermixed with other code.

@odeke-em
Copy link
Member

@odeke-em odeke-em commented Sep 3, 2017

Looks somewhat like an extension of #16503, but here we get the proper message only with -l. /cc @griesemer and @rsc

@odeke-em
Copy link
Member

@odeke-em odeke-em commented Oct 18, 2018

Thank you @dvyukov for filing this bug, it'll be fixed along with #21752

@griesemer
Copy link
Contributor

@griesemer griesemer commented Dec 5, 2018

Moving to 1.13 like #21752.

@griesemer griesemer modified the milestones: Go1.12, Go1.13 Dec 5, 2018
@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019
@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
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
6 participants
You can’t perform that action at this time.