Note [nonDetCmpType nondeterminism]
nonDetCmpType is implemented in terms of nonDetCmpTypeX. nonDetCmpTypeX uses nonDetCmpTc which compares TyCons by their Unique value. Using Uniques for ordering leads to nondeterminism. We hit the same problem in the TyVarTy case, comparing type variables is nondeterministic, note the call to nonDetCmpVar in nonDetCmpTypeX. See Note [Unique Determinism] for more details.
References 1
- Unique Determinism GHC.Types.Unique
Referenced by 2
- GHC.Core.TyCo.Compare call site
- Deterministic simplifyInstanceContexts GHC.Tc.Deriv.Infer