• Sebastian Graf's avatar
    Check EmptyCase by simply adding a non-void constraint · 1593debf
    Sebastian Graf authored
    We can handle non-void constraints since !1733, so we can now express
    the strictness of `-XEmptyCase` just by adding a non-void constraint
    to the initial Uncovered set.
    
    For `case x of {}` we thus check that the Uncovered set `{ x | x /~ ⊥ }`
    is non-empty. This is conceptually simpler than the plan outlined in
     #17376, because it talks to the oracle directly.
    
    In order for this patch to pass the testsuite, I had to fix handling of
    newtypes in the pattern-match checker (#17248).
    
    Since we use a different code path (well, the main code path) for
    `-XEmptyCase` now, we apparently also handle #13717 correctly.
    There's also some dead code that we can get rid off now.
    
    `provideEvidence` has been updated to provide output more in line with
    the old logic, which used `inhabitationCandidates` under the hood.
    
    A consequence of the shift away from the `UncoveredPatterns` type is
    that we don't report reduced type families for empty case matches,
    because the pretty printer is pure and only knows the match variable's
    type.
    
    Fixes #13717, #17248, #17386
    1593debf
Name
Last commit
Last update
..
ClsInst.hs Loading commit data...
Constraint.hs Loading commit data...
FamInst.hs Loading commit data...
Flattening-notes Loading commit data...
FunDeps.hs Loading commit data...
Inst.hs Loading commit data...
TcAnnotations.hs Loading commit data...
TcArrows.hs Loading commit data...
TcBackpack.hs Loading commit data...
TcBinds.hs Loading commit data...
TcCanonical.hs Loading commit data...
TcClassDcl.hs Loading commit data...
TcDefaults.hs Loading commit data...
TcDeriv.hs Loading commit data...
TcDerivInfer.hs Loading commit data...
TcDerivUtils.hs Loading commit data...
TcEnv.hs Loading commit data...
TcEnv.hs-boot Loading commit data...
TcErrors.hs Loading commit data...
TcEvTerm.hs Loading commit data...
TcEvidence.hs Loading commit data...
TcExpr.hs Loading commit data...
TcExpr.hs-boot Loading commit data...
TcFlatten.hs Loading commit data...
TcForeign.hs Loading commit data...
TcGenDeriv.hs Loading commit data...
TcGenFunctor.hs Loading commit data...
TcGenGenerics.hs Loading commit data...
TcHoleErrors.hs Loading commit data...
TcHoleErrors.hs-boot Loading commit data...
TcHoleFitTypes.hs Loading commit data...
TcHoleFitTypes.hs-boot Loading commit data...
TcHsSyn.hs Loading commit data...
TcHsType.hs Loading commit data...
TcInstDcls.hs Loading commit data...
TcInstDcls.hs-boot Loading commit data...
TcInteract.hs Loading commit data...
TcMType.hs Loading commit data...
TcMatches.hs Loading commit data...
TcMatches.hs-boot Loading commit data...
TcOrigin.hs Loading commit data...
TcPat.hs Loading commit data...
TcPatSyn.hs Loading commit data...
TcPatSyn.hs-boot Loading commit data...
TcPluginM.hs Loading commit data...
TcRnDriver.hs Loading commit data...
TcRnDriver.hs-boot Loading commit data...
TcRnExports.hs Loading commit data...
TcRnMonad.hs Loading commit data...
TcRnTypes.hs Loading commit data...
TcRnTypes.hs-boot Loading commit data...
TcRules.hs Loading commit data...
TcSMonad.hs Loading commit data...
TcSigs.hs Loading commit data...
TcSimplify.hs Loading commit data...
TcSplice.hs Loading commit data...
TcSplice.hs-boot Loading commit data...
TcTyClsDecls.hs Loading commit data...
TcTyDecls.hs Loading commit data...
TcType.hs Loading commit data...
TcType.hs-boot Loading commit data...
TcTypeNats.hs Loading commit data...
TcTypeable.hs Loading commit data...
TcUnify.hs Loading commit data...
TcUnify.hs-boot Loading commit data...
TcValidity.hs Loading commit data...