#4799: Imprecise error regarding SPECIALIZE and INLINE/INLINABLE pragmas
---------------------------------+------------------------------------------
    Reporter:  dreixel           |       Owner:              
        Type:  bug               |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  7.0.1             |    Keywords:              
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 Consider the following two modules:
 {{{
 module Test1 where

 {-# INLINE f1 #-}
 f1 :: (Num a) => a -> a
 f1 a = a

 module Test2 where

 import Test1

 {-# SPECIALIZE f1 :: Int -> Int #-}
 }}}

 Compiling with ghc --make Test2 gives
 {{{
     You cannot SPECIALISE `f1'
       because its definition has no INLINE/INLINABLE pragma
 }}}
 But 'f1' clearly has an INLINE pragma. Adding the -O flag solves the
 problem. I think the error message given when compiling without
 optimization could be improved, perhaps mentioning that inlining pragmas
 are ignored when compiling without optimization.

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