Commit cbe382d4 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com
Browse files

Make isIrrefutableHsPat say True for existentials; fixes Trac #4439

At last. A bug that is really easy to fix.
parent 9a81ddfb
......@@ -47,6 +47,7 @@ import SrcLoc
import FastString
-- libraries:
import Data.Data hiding (TyCon)
import Data.Maybe
\end{code}
......@@ -411,7 +412,9 @@ isIrrefutableHsPat pat
go1 (ConPatIn {}) = False -- Conservative
go1 (ConPatOut{ pat_con = L _ con, pat_args = details })
= isProductTyCon (dataConTyCon con)
= isJust (tyConSingleDataCon_maybe (dataConTyCon con))
-- NB: tyConSingleDataCon_maybe, *not* isProductTyCon, because
-- the latter is false of existentials. See Trac #4439
&& all go (hsConPatArgs details)
go1 (LitPat {}) = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment