Opened 2 years ago

Closed 2 years ago

#14034 closed bug (duplicate)

GHC crash instead of compile error on GHC 8.2 with ApplicativeDo

Reported by: nh2 Owned by: simonmar
Priority: highest Milestone: 8.2.2
Component: Compiler Version: 8.2.1
Keywords: Cc: nh2
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash or panic Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

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

Change History (3)

comment:1 Changed 2 years ago by nh2

sam2_: I'd just like to note that this also happens to valid code; the undefined names aren't essential to reproduction

comment:2 Changed 2 years ago by simonpj

Milestone: 8.2.2
Owner: set to simonmar
Priority: normalhighest

An infinite loop in the compiler is bad! Something to do with renaming I think.

Simon M: would you like to look?

comment:3 Changed 2 years ago by simonmar

Resolution: duplicate
Status: newclosed

Closing in favour of #14163

Note: See TracTickets for help on using tickets.