#4227: Allow SPECIALISE pragmas for functions defined in another module
---------------------------+------------------------------------------------
  Reporter:  simonpj       |          Owner:                  
      Type:  bug           |         Status:  closed          
  Priority:  normal        |      Milestone:  7.2.1           
 Component:  Compiler      |        Version:  6.12.3          
Resolution:  fixed         |       Keywords:                  
  Testcase:                |      Blockedby:                  
Difficulty:                |             Os:  Unknown/Multiple
  Blocking:                |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown  |  
---------------------------+------------------------------------------------

Comment(by dreixel):

 Is this working for class methods too? See the following example:

 {{{
 module M1 where

 class MyEnum a where
   {-# INLINABLE myEnum #-}
   myEnum :: [a]

 instance MyEnum () where myEnum = [()]

 {-# INLINABLE myEnum' #-}
 myEnum' :: (MyEnum a) => [a]
 myEnum' = myEnum
 }}}
 {{{
 module M2 where

 import M1

 {-# SPECIALISE myEnum  :: [()] #-}
 {-# SPECIALISE myEnum' :: [()] #-}

 }}}

 The first SPECIALISE pragma gives {{{You cannot SPECIALISE `myEnum'
 because its definition has no INLINE/INLINABLE pragma}}}, whereas the
 second works fine. I would expect the first to work too.

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