Skip to content

GHC crash instead of compile error on GHC 8.2 with ApplicativeDo

I'm filing this a sa proxy for user sam2_ from IRC:

$ cat Bug.hs
{-# LANGUAGE ApplicativeDo #-}
module Bug where

doc = do
  () <- a
  () <- b
  c' <- c
  return d
$ ghc-8.2.1 Bug.hs
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )
ghc: out of memory (requested 1048576 bytes)
$ ghc-8.0.2 Bug.hs
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )

Bug.hs:5:9: error: Variable not in scope: a :: f ()

Bug.hs:6:9: error: Variable not in scope: b :: f ()

Bug.hs:7:9: error: Variable not in scope: c :: f a0

Bug.hs:8:10: error: Variable not in scope: d
Trac metadata
Trac field Value
Version 8.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC nh2
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information