Packages That Do Not Type-Check

Reference index · Summary of this topic

A package the Go type checker could not fully resolve still converts, best-effort, and the run continues. This is not a tolerance the standard-library conversion needs — every stdlib package type-checks — but -recurse converts whatever an end-user module’s closure reaches, and some of that legitimately does not resolve on the converting host: an app package naming a symbol that only exists behind a build tag, a cgo-only file, a third-party package whose own import failed. go/packages returns these WITH errors rather than failing the load.

The rules, in the order they matter:

Guarded by untypedPackageConversion_test.go — one test converts a package mixing six invalid-operand shapes with healthy code and requires the healthy declarations to survive; the other injects a fault into the escape analysis and requires the caller to receive it — and by untypedRegionShapes_test.go, which converts one invalid operand in every expression context the visitor has a path for, with the per-file recover off so a fault surfaces as a panic, and checks that the untyped region is reported as a GO2CS1003 diagnostic rather than a visit file error.


← Deterministic Output · Index