#4846: Newtype derving used wrongly
---------------------------------+------------------------------------------
    Reporter:  simonpj           |        Owner:              
        Type:  bug               |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  7.0.1       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------
 Emil Axelsson reports: I attach a program `Test.hs` which I suspect
 demonstrates a bug in GHC. The important lines are:
 {{{
    showType :: forall a . Expr a -> String
    showType (Lit _) = show (typeOf (undefined :: a))

    test1 = showType (mk     :: Expr BOOL) -- Prints "Bool" (wrong?)
    test2 = showType (Lit mk :: Expr BOOL) -- Prints "Main.BOOL" (correct)
 }}}
 `test1` and `test2` give different results, even though showType shouldn't
 be able to tell them apart. It seems that the `Typeable` context packed
 with the Lit constructor is wrong in `test2`.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4846>
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