Commit 0545b550 authored by Simon Marlow's avatar Simon Marlow
Browse files

dsCImport (CLabel): drop foralls when checking for FunPtr

We were mislabelling some foreign imports as IsData rather than
IsFunction, because the type was forall a. FunPtr (... a ...).

Eventually this gave rise to these obscure error when compiling
unregisterised:

libraries/base/Foreign/Marshal/Alloc.hc:473:0:
     warning: built-in function ‘free’ declared as non-function

libraries/base/Foreign/Marshal/Alloc.hc:1004:0:
     error: ‘free’ redeclared as different kind of symbol
parent 71963675
......@@ -138,7 +138,7 @@ dsCImport :: Id
-> DsM ([Binding], SDoc, SDoc)
dsCImport id co (CLabel cid) cconv _ _ = do
let ty = pFst $ coercionKind co
fod = case tyConAppTyCon_maybe ty of
fod = case tyConAppTyCon_maybe (dropForAlls ty) of
Just tycon
| tyConUnique tycon == funPtrTyConKey ->
IsFunction
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment