Note [Core Lint guarantee]
Core Lint is the type-checker for Core. Using it, we get the following guarantee: If all of: 1. Core Lint passes, 2. there are no unsafe coercions (i.e. unsafeEqualityProof), 3. all plugin-supplied coercions (i.e. PluginProv) are valid, and 4. all case-matches are complete then running the compiled program will not seg-fault, assuming no bugs downstream (e.g. in the code generator). This guarantee is quite powerful, in that it allows us to decouple the safety of the resulting program from the type inference algorithm. However, do note point (4) above. Core Lint does not check for incomplete case-matches; see Note [Case expression invariants] in GHC.Core, invariant (4). As explained there, an incomplete case-match might slip by Core Lint and cause trouble at runtime.
References 1
- Case expression invariants GHC.Core
Referenced by 5
- GHC.Core.Lint call site ×2
- Case expression invariants GHC.Core
- GHC.Core.Lint.Interactive call site
- GHC.Driver.Config.Core.Lint call site