Opened 2 years ago

Closed 2 years ago

#7252 closed bug (duplicate)

Impossible error when deriving lower-cased type class (nameModule show{tv a9Y})

Reported by: sfogarty Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.4.2
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

I had a student who incorrectly typed 'deriving (show)' instead of 'deriving (Show)', and got a very interesting error, as shown below. It happens in both ghc and ghci. The file should of course be rejected, but perhaps with a different error message.

$ cat Bug.hs
module Types where
data FuelEfficiency = MPG Float | LPHK Float deriving (show)
$ ghc Bug.hs
[1 of 1] Compiling Types ( Bug.hs, Bug.o )
ghc: panic! (the 'impossible' happened)

(GHC version 7.4.2 for x86_64-unknown-linux):

nameModule show{tv a9Y}

Change History (1)

comment:1 Changed 2 years ago by guest

  • Resolution set to duplicate
  • Status changed from new to closed

This is already fixed in GHC 7.6, bug #5961.

Note: See TracTickets for help on using tickets.