#7252: Impossible error when deriving lower-cased type class (nameModule show{tv
a9Y})
--------------------------------+-------------------------------------------
 Reporter:  sfogarty            |          Owner:                
     Type:  bug                 |         Status:  new           
 Priority:  normal              |      Component:  Compiler      
  Version:  7.4.2               |       Keywords:                
       Os:  Linux               |   Architecture:  x86_64 (amd64)
  Failure:  Compile-time crash  |       Testcase:                
Blockedby:                      |       Blocking:                
  Related:                      |  
--------------------------------+-------------------------------------------
 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}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7252>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to