-
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
go/types: interface.Complete panics for interfaces with duplicate methods #61737
Comments
Hi @istonegithub, thanks for reporting. Is this crash reproducible for you? |
I have a reproducer:
Unlike var types, X will not be completed during type checking, so we encounter an incomplete interface that has duplicate methods, and therefore panic. I'll note that we also panic when importing any package containing interfaces with duplicate methods, as the importer calls Complete(), but that panic is recovered. CC @griesemer: I think it is incorrect for computeInterfaceTypeSet to panic here. Compare with the "cannot handle more than %d union terms..." error message in computeUnionTypeSet. |
Change https://go.dev/cl/515555 mentions this issue: |
@gopherbot please backport to Go 1.21. This is a deterministic panic when correctly using the go/types API. |
Backport issue(s) opened: #61743 (for 1.21), #61744 (for 1.20). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/515636 mentions this issue: |
@gopherbot please backport to Go 1.20. This is a deterministic panic when correctly using the go/types API. |
Change https://go.dev/cl/515638 mentions this issue: |
…e completion It should be possible for the importer to construct an invalid interface, as would have been produced by type checking. Updates #61737 Fixes #61743 Change-Id: I72e063f4f1a6205d273a623acce2ec08c34c3cc2 Reviewed-on: https://go-review.googlesource.com/c/go/+/515555 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Findley <rfindley@google.com> Reviewed-by: Olif Oftimis <oftimisolif@gmail.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit d2ee782) Reviewed-on: https://go-review.googlesource.com/c/go/+/515636 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
…e completion It should be possible for the importer to construct an invalid interface, as would have been produced by type checking. Updates #61737 Fixes #61744 Change-Id: I72e063f4f1a6205d273a623acce2ec08c34c3cc2 Reviewed-on: https://go-review.googlesource.com/c/go/+/515555 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Findley <rfindley@google.com> Reviewed-by: Olif Oftimis <oftimisolif@gmail.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit d2ee782) Reviewed-on: https://go-review.googlesource.com/c/go/+/515638 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
gopls version: v0.13.1 (go1.20.4)
gopls flags:
update flags: proxy
extension version: 0.39.1
go version: 1.20.4
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Thu, 03 Aug 2023 05:31:10 GMT
restart history:
Wed, 02 Aug 2023 07:06:29 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.
NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.
<OPTIONAL: ATTACH LOGS HERE>
The text was updated successfully, but these errors were encountered: