[GHC] #9352: Allow `State# s` argument/result types in `ccall` FFI imports

GHC ghc-devs at haskell.org
Fri Jul 25 10:17:28 UTC 2014


#9352: Allow `State# s` argument/result types in `ccall` FFI imports
-------------------------------------+-------------------------------------
              Reporter:  hvr         |            Owner:
                  Type:  feature     |           Status:  new
  request                            |        Milestone:  7.10.1
              Priority:  normal      |          Version:  7.8.2
             Component:  Compiler    |         Keywords:
  (Type checker)                     |     Architecture:  Unknown/Multiple
            Resolution:              |       Difficulty:  Unknown
      Operating System:              |       Blocked By:
  Unknown/Multiple                   |  Related Tickets:  #9281
       Type of failure:              |
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 OK, so here's the patch I'm guessing you tried
 {{{
         Modified compiler/typecheck/TcType.lhs
 diff --git a/compiler/typecheck/TcType.lhs b/compiler/typecheck/TcType.lhs
 index a952ce7..d643f6e 100644
 --- a/compiler/typecheck/TcType.lhs
 +++ b/compiler/typecheck/TcType.lhs
 @@ -1556,10 +1556,11 @@ marshalableTyCon :: DynFlags -> TyCon -> Bool
  marshalableTyCon dflags tc
    =  (xopt Opt_UnliftedFFITypes dflags
        && isUnLiftedTyCon tc
 -      && not (isUnboxedTupleTyCon tc)
 -      && case tyConPrimRep tc of        -- Note [Marshalling VoidRep]
 -           VoidRep -> False
 -           _       -> True)
 +--      && not (isUnboxedTupleTyCon tc)
 +--      && case tyConPrimRep tc of        -- Note [Marshalling VoidRep]
 +--           VoidRep -> False
 +--           _       -> True
 +     )
    || boxedMarshalableTyCon tc
 }}}

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


More information about the ghc-tickets mailing list