
Thanks. This was being tracked in Trac #9567, and I have finally gotten around to fixing it. Your proposed change is small, but it simply avoids the crash without fixing the cause. The cause was that contInputType was simply *wrong*.
https://ghc.haskell.org/trac/ghc/ticket/9567
Fixed now!
Simon
| -----Original Message-----
| From: Yuras Shumovich [mailto:shumovichy@gmail.com]
| Sent: 08 December 2014 05:48
| To: Simon Peyton Jones
| Cc: ghc-devs@haskell.org Devs
| Subject: Re: Typechecker tests failures
|
|
| Simon,
|
| I tracked T7891 and tc124 failure down to simplifier, namely
| `simplExprF1` for `Case`. Core lint catches the bug (requires -O1 at
| least), but without -dcore-lint compiler hangs in busy loop. I made it
| work with simple patch:
|
| > diff --git a/compiler/simplCore/Simplify.hs
| > b/compiler/simplCore/Simplify.hs index 7611f56..d396b60 100644
| > --- a/compiler/simplCore/Simplify.hs
| > +++ b/compiler/simplCore/Simplify.hs
| > @@ -950,8 +950,10 @@ simplExprF1 env expr@(Lam {}) cont
| > zap b | isTyVar b = b
| > | otherwise = zapLamIdInfo b
| >
| > -simplExprF1 env (Case scrut bndr _ alts) cont
| > - = simplExprF env scrut (Select NoDup bndr alts env cont)
| > +simplExprF1 env (Case scrut bndr alts_ty alts) cont
| > + = do { expr <- simplExprC env scrut (Select NoDup bndr alts env
| > + (mkBoringStop alts_ty))
| > + ; rebuild env expr cont }
| >
| > simplExprF1 env (Let (Rec pairs) body) cont
| > = do { env' <- simplRecBndrs env (map fst pairs)
|
| (I have no idea what most of this code does, but I learned a lot while
| investigating this issue :) )
|
| The relevant commit is:
|
| > commit a0b2897ee406e24a05c41768a0fc2395442dfa06
| > Author: Simon Peyton Jones