Note [TcLevel of ExpType]
Consider
data G a where
MkG :: G Bool
foo MkG = True
This is a classic untouchable-variable / ambiguous GADT return type
scenario. But, with ExpTypes, we'll be inferring the type of the RHS.
We thus must track a TcLevel in an Inferring ExpType. If we try to
fill the ExpType and find that the TcLevels don't work out, we fill
the ExpType with a tau-tv at the low TcLevel, hopefully to be worked
out later by some means -- see fillInferResult, and Note [fillInferResult]
This behaviour triggered in test gadt/gadt-escape1. References 1
- fillInferResult GHC.Tc.Utils.Unify
Referenced by 4
- FixedRuntimeRep context in ExpType GHC.Tc.Utils.TcMType
- GHC.Tc.Utils.TcMType call site
- inferResultToType GHC.Tc.Utils.TcMType
- GHC.Tc.Utils.TcType call site