[GHC] #5821: SPECIALISE fails with a cryptic warning

GHC cvs-ghc at haskell.org
Tue Jun 26 13:55:54 CEST 2012


#5821: SPECIALISE fails with a cryptic warning
---------------------------------+------------------------------------------
    Reporter:  rl                |       Owner:                                   
        Type:  bug               |      Status:  new                              
    Priority:  normal            |   Milestone:  7.6.1                            
   Component:  Compiler          |     Version:  7.5                              
    Keywords:                    |          Os:  Unknown/Multiple                 
Architecture:  Unknown/Multiple  |     Failure:  Incorrect warning at compile-time
  Difficulty:  Unknown           |    Testcase:                                   
   Blockedby:                    |    Blocking:                                   
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by illissius):

 Just to amuse matters further, these both work, with both 7.0 and 7.4:
 {{{
 foo :: (Num a, b ~ T a) => a -> b
 {-# SPECIALISE foo :: b ~ Bool => Int -> b #-}
 }}}
 {{{
 foo :: (Num a, b ~ T a) => a -> b
 {-# SPECIALISE foo :: Int -> Bool #-}
 }}}
 that is, completely the opposite of the original example, now it works if
 and only if I *do* expand the type family, and it doesn't matter what I do
 with the equality constraint.

 (FTR I'm testing with 7.0 and 7.4 because I don't have a 7.2 on hand.)

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



More information about the Glasgow-haskell-bugs mailing list