-
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
go/types: specious "invalid recursive type" error? #60130
Comments
Seems pretty clearly disallowed by the current spec wording: https://go.dev/ref/spec#Interface_types:
But I don't see the technical reason why the restriction is necessary in this case, as s.i is an ordinary named field. |
The spec rule seems not sufficiently precisely spelled out. And there's probably a bug in the cycle check. Not urgent but added to my plate. Thanks for reporting. |
Too late for 1.21. |
Too late for 1.23. Moving to 1.24. |
This issue is currently labeled as early-in-cycle for Go 1.24. |
Too late for 1.24. Moving to 1.25. |
Given:
go/types currently reports:
Notably, changing the field type from
i
to*i
makes the error go away. I don't see any fundamental reason why that should make a difference though.Synthetic test case, constructed while trying to write additional test cases for #60117.
/cc @adonovan @findleyr @griesemer @ianlancetaylor
The text was updated successfully, but these errors were encountered: