-
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: import issue with self-referential generic interface type #48280
Comments
This appears to be a compiler bug. I was able to reproduce it using this build script, outside of the go command:
_testmain.go is generated:
|
This seems to be the problem in the importer. After creating stub declaration, it recursively declaring the type, which in turn Maybe we can just check if the
cc @findleyr |
Thanks for the report. Somewhat related: #48098. We need more controls around recursive instantiation. CC @griesemer |
Note that the package build ok with cmd/compile, and typecheck ok with go/types. The problem only happens when import package. |
Ack, right. Perhaps your suggested fix is the way to proceed. I will look into it. |
Change https://golang.org/cl/349009 mentions this issue: |
Change https://golang.org/cl/349010 mentions this issue: |
…wice This is port of CL 349009 to go/internal/gcimporter. Updates #48280 Change-Id: I7d40d8b67333538ca58fe012535d54e891d0ed16 Reviewed-on: https://go-review.googlesource.com/c/go/+/349010 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
I see an unexpected error when I run
go test
on the following code:The error that I see is:
The text was updated successfully, but these errors were encountered: