Ticket #4799 (closed bug: fixed)
Imprecise error regarding SPECIALIZE and INLINE/INLINABLE pragmas
Description
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.
Change History
Note: See
TracTickets for help on using
tickets.
