Ticket #7243 (new bug)
regression: acceptable foreign result types
| Reported by: | dmwit | Owned by: | igloo |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.6.2 |
| Component: | Compiler (FFI) | Version: | 7.6.1 |
| Keywords: | Cc: | gostrc@…, malaquias@… | |
| Operating System: | Unknown/Multiple | Architecture: | x86_64 (amd64) |
| Type of failure: | GHC rejects valid program | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
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,
* all basic foreign types are marshallable foreign types, and
* 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.)
Change History
Note: See
TracTickets for help on using
tickets.
