Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#10461 closed bug (fixed)

Suggest UnliftedFFITypes when applicable

Reported by: ezyang Owned by: ezyang
Priority: low Milestone: 8.0.1
Component: Compiler (Type checker) Version: 7.11
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Test Case: ffi/should_fail/T10461
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Here's an example bad error message:

    Unacceptable result type in foreign declaration:
      ‘Word#’ cannot be marshalled in a foreign call
    When checking declaration:
      foreign import prim safe "static chenycopy" cheneycopy
        :: Any -> Word#

We should also add something like:

    To enable marshalling unlifted types, enable -XUnliftedFFITypes

Change History (3)

comment:1 Changed 3 years ago by Simon Peyton Jones <simonpj@…>

In 3758050f02c1de6af41c50ed122b3df012d400ff/ghc:

Improve FFI error reporting

I refactored TcType FFI functions to return Validity rather than Bool,
which turned out to be an easy way to solve Trac #10461.

comment:2 Changed 3 years ago by simonpj

Resolution: fixed
Status: newclosed
Test Case: ffi/should_fail/T10461

Good idea and easily done.


comment:3 Changed 3 years ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.