-
Notifications
You must be signed in to change notification settings - Fork 18k
go/types: panic "assertion failed" when autocompleting generic test code #47923
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
Comments
Thanks for reporting. CC @griesemer |
The compiler didn't like my code either 😭 #47924 |
Some of the new type-checker code is probably not as fault-tolerant yet as the old code. |
The failing assertion is this one (judging from revision and stack trace): // TODO(gri) This is not always correct: two types may have the same names
// in the same package if one of them is nested in a function.
// Extremely unlikely but we need an always correct solution.
if x.obj.pkg == y.obj.pkg && x.obj.name == y.obj.name {
assert(len(xargs) == len(yargs))
for i, x := range xargs {
if !u.nify(x, yargs[i], p) {
return false
}
}
return true
} in |
@jayconrod Any chance you could play around some more with this and see if you can reproduce this? Without more input I fear this issue is not actionable. |
Moving milestone to 1.19. |
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.) |
The offending assertion has been removed in the code so this crash is likely fixed. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
no, just
master
as of todayWhat operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Started parameterizing
cmd/go/internal/par.Cache
. See CL 344513.This happened as I was adding type arguments to the
cache
variable incache_test.go
. The file looked like this:What did you expect to see?
nothing exciting
What did you see instead?
gopls crashed with the panic below:
Full output attached (too big for comment): types-assertion-failed.txt
Unfortunately, I couldn't reproduce this. Everything worked after reloading the editor window.
cc @findleyr
The text was updated successfully, but these errors were encountered: