APPLY needs a catch all case for type constructors
Normally, they get erased, but in case they haven't at compile time this
ensures they are at run-time. It's safe just to return an erased term
since it can't be inspected. Fixes #416
(This may mean something is wrong in erasure, or it may simply be that
something is sufficiently higher order that the unused argument checker
doesn't feel it is safe to erase.)
commitc2efaddaf6c3cdb18ed8ff2fa95a2019dc3e7c37
authorEdwin Brady <ecb10@st-andrews.ac.uk>
dateWed 24 Jul 2013, 11:30 (13 years ago)
parent7427990
src/IRTS/Defunctionalise.hs+2−1
@@ -218,7 +218,8 @@ mkApply xs = (MN 0 "APPLY", DFun (MN 0 "APPLY") [MN 0 "fn", MN 0 "arg"]
218218 mkBigCase (MN 0 "APPLY") 256
219219 (DApp False (MN 0 "EVAL")
220220 [DV (Glob (MN 0 "fn"))])
221− cases))
221+ (cases ++
222+ [DDefaultCase DNothing])))
222223 where
223224 applyCase (n, t, ApplyCase x) = Just x
224225 applyCase _ = Nothing