[GHC] #7243: regression: acceptable foreign result types

GHC ghc-devs at haskell.org
Tue Nov 25 02:11:28 UTC 2014


#7243: regression: acceptable foreign result types
-------------------------------------+-------------------------------------
              Reporter:  dmwit       |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:  7.10.1
             Component:  Compiler    |          Version:  7.6.1
  (FFI)                              |         Keywords:
            Resolution:              |     Architecture:  x86_64 (amd64)
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:  GHC         |  Related Tickets:
  rejects valid program              |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by thomie):

 In commit 92587bfefea2b78f89bcdad27e0da5711463fd1b:
 {{{
 Author: Simon Peyton Jones <>
 Date:   Fri Jul 25 16:22:21 2014 +0100

 Refactor FFI error messages

 This patch was provoked by Trac #5610, which I finally got a moment to
 look at.

 In the end I added a new data type ErrUtils.Validity,

   data Validity
     = IsValid            -- Everything is fine
     | NotValid MsgDoc    -- A problem, and some indication of why

 with some suitable combinators, and used it where appropriate (which
 touches
 quite a few modules).  The main payoff is that error messages improve for
 FFI type validation.
 }}}

 The error message is now:
 {{{
 $ ghc-7.9.20141121 test.hs
 [1 of 1] Compiling Foo              ( test.hs, test.o )

 test.hs:3:1:
     Unacceptable type in foreign declaration: One argument expected
     When checking declaration:
       foreign import ccall safe "wrapper" foo :: IO (FunPtr ())
 }}}

 Only a regression test is missing.

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


More information about the ghc-tickets mailing list