Commit 30e84fce authored by simonpj's avatar simonpj
Browse files

[project @ 2001-10-16 10:37:32 by simonpj]

Fix the default-expansion code for HEAD; fixes cg050
parent 43d343ab
......@@ -885,15 +885,19 @@ mkAlts scrut case_bndr alts@((con1,bndrs1,rhs1) : con_alts)
--------------------------------------------------
mkAlts scrut case_bndr alts
| Just (tycon, inst_tys) <- splitTyConApp_maybe (idType case_bndr),
isAlgTyCon tycon, -- It's a data type, tuple, or unboxed tuples.
-- We aren't expecting any newtypes at this point.
(alts_no_deflt, Just rhs) <- findDefault alts,
-- There is a DEFAULT case
| (alts_no_deflt, Just rhs) <- findDefault alts,
-- There is a DEFAULT case
Just (tycon, inst_tys) <- splitTyConApp_maybe (idType case_bndr),
isAlgTyCon tycon, -- It's a data type, tuple, or unboxed tuples.
not (isNewTyCon tycon), -- We can have a newtype, if we are just doing an eval:
-- case x of { DEFAULT -> e }
-- and we don't want to fill in a default for them!
[missing_con] <- filter is_missing (tyConDataConsIfAvailable tycon)
-- There is just one missing constructor!
= ASSERT( not (isNewTyCon tycon) )
tick (FillInCaseDefault case_bndr) `thenSmpl_`
-- There is just one missing constructor!
= tick (FillInCaseDefault case_bndr) `thenSmpl_`
getUniquesSmpl `thenSmpl` \ tv_uniqs ->
getUniquesSmpl `thenSmpl` \ id_uniqs ->
let
......
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