#1213: typecheck/TcTyClsDecls.lhs: Non-exhaustive patterns in function tcConDecl
-------------------------+--------------------------------------------------
    Reporter:  guest     |       Owner:         
        Type:  bug       |      Status:  new    
    Priority:  normal    |   Milestone:         
   Component:  Compiler  |     Version:  6.6    
    Severity:  normal    |    Keywords:         
  Difficulty:  Unknown   |    Testcase:         
Architecture:  Unknown   |          Os:  Unknown
-------------------------+--------------------------------------------------
The following code

 {{{
 module Main where

 newtype Test where
     T :: Int -> Test

 instance Show Test where
     show (T i) = show i

 main = putStrLn (show (T 3))
 }}}

 causes the compiler to crash with:

 {{{
 [1 of 1] Compiling Main             ( test2.hs, test2.o )
 ghc-6.6: panic! (the 'impossible' happened)
   (GHC version 6.6 for powerpc-apple-darwin):
         typecheck/TcTyClsDecls.lhs:(468,0)-(524,4): Non-exhaustive
 patterns in function tcConDecl


 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

 however changing 'newtype' to 'data' compiles without errors.

 Tested with GHC and GHCi 6.6 under Mac OS X 10.4.8 running on an iMac G5.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1213>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to