-
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
x/tools/gopls: panic in methodsets.NewIndex #60628
Comments
Thank you for the report (especially the repro!). We will fix this gopls crash. Moving to the Go issue tracker, since it is a gopls issue. |
CC @adonovan |
Let me echo Rob's thanks for providing a minimal reproducible test case--this was a tremendous help and time-saver. The root cause is a bug in OriginMethod for ill-typed methods where the receiver is |
On further digging, the problem is an inconsistency between NewMethodSet (which enumerates the methods, including the ill-typed one) and LookupFieldOrMethod (which disavows the ill-typed method). See #60634 |
Change https://go.dev/cl/501197 mentions this issue: |
This change adds to x/tools a workaround for a bug in go/types that causes LookupFieldOrMethod and NewTypeSet to be inconsistent wrt an ill-typed method (*T).f where T itself is a pointer. The workaround is that, if Lookup fails, we walk the MethodSet. Updates golang/go#60634 Fixes golang/go#60628 Change-Id: I87caa2ae077e5cdfa40b65a2f52e261384c91167 Reviewed-on: https://go-review.googlesource.com/c/tools/+/501197 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Run-TryBot: Alan Donovan <adonovan@google.com> gopls-CI: kokoro <noreply+kokoro@google.com>
gopls version: v0.12.2 (go1.20.4)
gopls flags:
update flags: proxy
extension version: 0.38.0
go version: 1.20.4
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Tue, 06 Jun 2023 01:34:11 GMT
restart history:
Tue, 06 Jun 2023 01:29:42 GMT: manual (enabled: true)
Tue, 06 Jun 2023 01:30:36 GMT: manual (enabled: true)
Tue, 06 Jun 2023 01:30:44 GMT: manual (enabled: true)
Tue, 06 Jun 2023 01:30:47 GMT: manual (enabled: true)
Tue, 06 Jun 2023 01:31:01 GMT: manual (enabled: true)
Tue, 06 Jun 2023 01:31:34 GMT: manual (enabled: true)
Tue, 06 Jun 2023 01:32:02 GMT: manual (enabled: true)
Tue, 06 Jun 2023 01:32:14 GMT: manual (enabled: true)
Tue, 06 Jun 2023 01:32:44 GMT: manual (enabled: true)
Tue, 06 Jun 2023 01:33:04 GMT: manual (enabled: true)
Tue, 06 Jun 2023 01:34:09 GMT: manual (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
The following code immediately caused a crash.
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: