summaryrefslogtreecommitdiff
path: root/compiler/GHC/HsToCore/Match
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2020-03-27 17:22:28 -0400
committerRyan Scott <ryan.gl.scott@gmail.com>2020-04-07 19:43:20 -0400
commit04b6cf947ea065a210a216cc91f918cc1660d430 (patch)
tree60d3192ca3997385988bab216707193cb4c3c2da /compiler/GHC/HsToCore/Match
parent255418da5d264fb2758bc70925adb2094f34adc3 (diff)
downloadhaskell-04b6cf947ea065a210a216cc91f918cc1660d430.tar.gz
Make NoExtCon fields strictwip/strict-NoExtCon
This changes every unused TTG extension constructor to be strict in its field so that the pattern-match coverage checker is smart enough any such constructors are unreachable in pattern matches. This lets us remove nearly every use of `noExtCon` in the GHC API. The only ones we cannot remove are ones underneath uses of `ghcPass`, but that is only because GHC 8.8's and 8.10's coverage checkers weren't smart enough to perform this kind of reasoning. GHC HEAD's coverage checker, on the other hand, _is_ smart enough, so we guard these uses of `noExtCon` with CPP for now. Bumps the `haddock` submodule. Fixes #17992.
Diffstat (limited to 'compiler/GHC/HsToCore/Match')
-rw-r--r--compiler/GHC/HsToCore/Match/Literal.hs2
1 files changed, 0 insertions, 2 deletions
diff --git a/compiler/GHC/HsToCore/Match/Literal.hs b/compiler/GHC/HsToCore/Match/Literal.hs
index 3afc455e99..17bf1484b2 100644
--- a/compiler/GHC/HsToCore/Match/Literal.hs
+++ b/compiler/GHC/HsToCore/Match/Literal.hs
@@ -103,7 +103,6 @@ dsLit l = do
HsString _ str -> mkStringExprFS str
HsInteger _ i _ -> mkIntegerExpr i
HsInt _ i -> return (mkIntExpr platform (il_value i))
- XLit nec -> noExtCon nec
HsRat _ (FL _ _ val) ty -> do
num <- mkIntegerExpr (numerator val)
denom <- mkIntegerExpr (denominator val)
@@ -125,7 +124,6 @@ dsOverLit (OverLit { ol_val = val, ol_ext = OverLitTc rebindable ty
case shortCutLit platform val ty of
Just expr | not rebindable -> dsExpr expr -- Note [Literal short cut]
_ -> dsExpr witness
-dsOverLit (XOverLit nec) = noExtCon nec
{-
Note [Literal short cut]
~~~~~~~~~~~~~~~~~~~~~~~~