#7243: regression: acceptable foreign result types
---------------------------------------+------------------------------------
 Reporter:  dmwit                      |          Owner:                
     Type:  bug                        |         Status:  new           
 Priority:  normal                     |      Component:  Compiler      
  Version:  7.6.1                      |       Keywords:                
       Os:  Unknown/Multiple           |   Architecture:  x86_64 (amd64)
  Failure:  GHC rejects valid program  |       Testcase:                
Blockedby:                             |       Blocking:                
  Related:                             |  
---------------------------------------+------------------------------------
 The following short file is rejected:

 {{{
 import Foreign.Ptr
 foreign import ccall "wrapper" foo :: IO (FunPtr ())
 }}}

 The error is:

 {{{
 test.hs:2:1:
     Unacceptable type in foreign declaration: IO (FunPtr ())
     When checking declaration:
       foreign import ccall safe "wrapper" foo :: IO (FunPtr ())
 }}}

 However, my reading of the 2010 Report suggests this should be acceptable.
 Specifically:

 * Prelude.IO t is a marshallable foreign result type when t is a
 marshallable foreign type,[[BR]]
 * all basic foreign types are marshallable foreign types, and[[BR]]
 * FunPtr a is a basic foreign type for all a.

 (Political note: I include this chain of reasoning not because I think
 others too stupid to recreate it, but because I think it likely that I am
 not reading the Report correctly, and want to make it easy to detect and
 correct any misconceptions I have.)

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to