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

dvyukov opened this Issue Sep 3, 2017 · 3 comments


None yet
4 participants
Copy link

dvyukov commented Sep 3, 2017

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

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.


This comment has been minimized.

Copy link

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


This comment has been minimized.

Copy link

odeke-em commented Oct 18, 2018

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


This comment has been minimized.

Copy link

griesemer commented Dec 5, 2018

Moving to 1.13 like #21752.

@griesemer griesemer modified the milestones: Go1.12, Go1.13 Dec 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.