-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: type checking fails in cycle involving recursive struct and unsafe.Sizeof #14620
Comments
Could this also be the case (when using cgo): |
@davmaz No, the problem there is simply that unsafe.Sizeof takes a value, not a type. It's not the same as the C sizeof operation. In general, for the Go project, please ask questions in a forum rather than on the issue tracker. See https://golang.org/wiki/Questions. Thanks. |
The problem is that when typechecking a pointer to a named type like A workaround is to move the |
Quite possibly Robert's front end revamp will take care of this. Maybe not worth worrying about before then. |
FWIW, gotype accepts this code w/o problems. Since there's a work-around per @mdempsky I don't think there's any urgency here. |
Reproduced at tip (00263a8) on May 10, 2017. Still seems low priority; punting to 1.10. |
FYI, both go/types and cmd/compile now reports an error as of go1.21 and tip:
|
Related #13890. |
package p
This should type check but does not:
Looks like the compiler gets confused by the not-quite-cycle in the definition.
http://play.golang.org/p/Hbmv1j_UrR
/cc @RLH
The text was updated successfully, but these errors were encountered: