-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: gopls panic with 'instantiated ident not found' #63933
Comments
Thanks for the report! @ForrestLinjianLi Transferring this to the main go repo for investigation. (cc @findleyr @adonovan) @ForrestLinjianLi Is the code public so we can try? Otherwise, can you run the following command from your workspace folder and share the output?
|
The stack indicates that a call f(g), where g itself has a generic function type, was instantiated, and the syntax of g was found not to be one of the following forms: I wonder whether it's possible that g was an anonymous function (FuncLit)? A better panic message would help. |
Change https://go.dev/cl/545615 mentions this issue: |
Updates #63933 Change-Id: I3ff71e92d124c850eb8b4d136e163bf5786897a2 Reviewed-on: https://go-review.googlesource.com/c/go/+/545615 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Findley <rfindley@google.com> Auto-Submit: Alan Donovan <adonovan@google.com>
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
Let's reopen this as we're waiting for information from crash reports from the field, and that could take several weeks. |
We probably won't get more data on this until the v0.15.0-pre.1 prerelease. But yes, this is definitely a real bug (albeit rare) as we've seen this in a couple google internal reports as well. Still need more info to diagnose. |
Repro'ed successfully (!) in golang/vscode-go#3114, thanks to @szesch's https://github.com/szesch/go-63933. Notably, this reproduces at go1.21.5, but not at master, so it may have been fixed. Investigating the root cause and bisecting the fix. |
Change https://go.dev/cl/554395 mentions this issue: |
This bug was inadvertently fixed in https://go.dev/cl/543176, though the root cause is addressed in https://go.dev/cl/554395. This was a latent bug that was activated by reverse type inference in Go 1.21. Since it will be fixed by Go 1.22, I don't think we need to back-port. |
Moved this to the Go 1.23 milestone, since it's not directly a gopls bug, it's already mitigated in 1.22, and we're not going to back-port the fix. |
The typeparams.IndexExpr wrapper type was added as a compatibility layer to make the go/types code symmetric with types2. However, this type incidentally implemented the ast.Expr interface, leading to the accidental misuse that led to golang#63933. Fix this minimally for now, though leave a TODO that this old compatibility shim really needs to be eliminated. Also fix a case in types2 where operand.expr was set to a typed nil. Fixes golang#63933 Change-Id: I180d411e52f795a8322ecce6ed8649e88af1c63b Reviewed-on: https://go-review.googlesource.com/c/go/+/554395 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
gopls version: v0.14.1 (go1.21.3)
gopls flags:
update flags: proxy
extension version: 0.39.1
go version: 1.21.3
environment: Visual Studio Code linux
initialization error: undefined
issue timestamp: Fri, 03 Nov 2023 00:14:18 GMT
restart history:
Thu, 02 Nov 2023 19:11:31 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: