-
Notifications
You must be signed in to change notification settings - Fork 18k
go/types: assertion failure in expr.go:978 (Checker.rawExpr) #20837
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
Simpler reproducer:
|
Now that we know how to work around this for Go 1.9 for the vetall builder (it was finding a real bug, but crashing instead of reporting it), I'm moving this to Go 1.10. But feel free to fix sooner if it's easy. |
There's a trivial fix, but it's perhaps too aggressive: The problem is that the vet is using a source importer with go/types (it has to). The source importer fails to import the syscall package because it has a bug, yet go/type continues to use that partially type-checked syscall package (to be able to do some type-checking, per #16088 as requested by @alandonovan). The simple solution is to not use an incomplete package, and then the crash disappears. Still checking if there's a softer approach. |
CL https://golang.org/cl/47074 mentions this issue. |
See also #16088 . |
To reproduce:
On top of commit
e6d9eda2fc13786c55292429b510128252ad8817
, applyhttps://go-review.googlesource.com/#/c/43512/:
git fetch https://go.googlesource.com/go refs/changes/12/43512/8 && git cherry-pick FETCH_HEAD
cd $GOROOT/src; GOOS=linux GOARCH=s390x CGO_ENABLED=0 go tool vet -unsafeptr=false -source archive/zip
Crash (after augmenting go/types to print a bit more information):
The text was updated successfully, but these errors were encountered: