Note [Canonicity for incoherent matches]
When the selected instance is INCOHERENT at step (IL4) of Note [Rules for instance lookup], we ignore all unifiers, whether or not they are marked with INCOHERENT pragmas. This is implemented by returning NoUnifiers in final_unifs. NoUnifiers takes an argument indicating whether the match was canonical as described in Note [Coherence and specialisation: overview] and Note [Recording coherence information in `PotentialUnifiers`]. To determine whether an incoherent match was canonical, we look *only* at the OverlapFlag of the instance being matched. For example: class C a instance {-# INCOHERENT #
References 3
- Coherence and specialisation: overview GHC.Core.InstEnv
- Recording coherence information in `PotentialUnifiers` GHC.Core.InstEnv
- Rules for instance lookup GHC.Core.InstEnv
Referenced by 2
- GHC.Core.InstEnv call site ×2