summaryrefslogtreecommitdiff
path: root/compiler/types
diff options
context:
space:
mode:
authorSebastian Graf <sgraf1337@gmail.com>2019-10-18 16:06:24 +0100
committerSebastian Graf <sebastian.graf@kit.edu>2019-10-30 10:58:40 +0100
commitb274f063837018cf48ac4e15bb8a726db2781389 (patch)
tree7c84d25c4707b2ef24f4ad44ba2c6f65b10e4a8b /compiler/types
parent6824f29aebd28571db118eb6877ef04eda630871 (diff)
downloadhaskell-b274f063837018cf48ac4e15bb8a726db2781389.tar.gz
Check EmptyCase by simply adding a non-void constraint
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
Diffstat (limited to 'compiler/types')
0 files changed, 0 insertions, 0 deletions