Description
Context: https://go-review.googlesource.com/c/tools/+/393017/comments/b58b52f4_30beeb0f
Getting types for cgo requires CompiledGoFiles because we need to run cgo preprocessing on the Go files before running the typechecker on them. We don't request compiled files by default when doing typechecking because for non-cgo files we can check types without .go files, but TestCgoNoSyntax relies on CompiledGoFiles being present on the output of the go command to properly check types.
It seems like either the test should need to explicitly request compiled files, or specify that it uses cgo (there's currently a non-exported bit for this), or maybe there should be some way for go/packages to upgrade to requesting compiled go files in certain circumstances where cgo is present?
cc: @bcmills