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: internal compiler error with self-referential method in interface #6638
Milestone
Comments
Related, but of simpler form: http://play.golang.org/p/peQWvRySw8 prog.go:6: type T has no method T.m prog.go:6: invalid expression unsafe.Sizeof(T.m) [process exited with non-zero status] (This package is accepted by gccgo and go/types). |
rsc
changed the title
cmd/gc: internal compiler error with self-referential method in interface
cmd/compile: internal compiler error with self-referential method in interface
Jun 8, 2015
@griesemer some good news and some bad news Your original program in #6638 (comment) now gives an error $ go tool compile x.go
x.go:6:25: cannot convert nil to type T However, the problems seems to still exist. |
Change https://golang.org/cl/139422 mentions this issue: |
gopherbot
pushed a commit
that referenced
this issue
Oct 4, 2018
LookupFieldOrMethod needs to know if a method receiver is a pointer type. Until now this was computed from the the method signature's receiver, which required the method signature to be type-checked. Furthermore, it required the receiver to be set before the method signature was fully type-checked in some cases (see issue #6638). This CL remembers this property during object resolution, when we know it from the source. With this CL, method signatures don't need to be type-checked before they can be looked up; this is a first step towards separating type checking of types and type-checking of associated methods. Updates #23203. Updates #26854. Change-Id: Ie3eb7976e8fe8176ea1b284fa7471a4b7000f80b Reviewed-on: https://go-review.googlesource.com/c/139422 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: