-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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, go/types, types2: unclear error message on initialization loop and invalid parameter type #47059
Comments
Is this a recent regression or has it been the case for some time now? |
I think CC @griesemer for type/semantic checking error messages? |
It is not a recent regression. With Go 1.13 the error is
|
Using $ go tool compile -G=3 x.go
x.go:3:5: invalid recursive type a
x.go:3:5: a refers to
x.go:5:6: f refers to
x.go:3:5: a
x.go:3:5: initialization loop for a
x.go:3:5: a refers to
x.go:5:6: f refers to
x.go:3:5: a Perhaps slightly better but there should be only one error message. Thanks for reporting. Marking for 1.18 in case there's an easy fix, but if not, this is certainly not urgent: we get an error message and we don't crash; also this is a somewhat rare error case. |
Not urgent. Moving to 1.19. |
With version 1.23, the behavior is now working as expected. Therefore, I am closing this issue as it has been resolved. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Execute this program
https://play.golang.org/p/5H8A96e3nn5
What did you expect to see?
What did you see instead?
With tip the error is
The text was updated successfully, but these errors were encountered: