diff options
author | Ian Lynagh <igloo@earth.li> | 2011-09-30 21:57:53 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-10-01 01:45:41 +0100 |
commit | 5b988961338f73af5790bfd365ca79c858249cea (patch) | |
tree | 44b28b8dd216e9a150676abc0da82da9da4b1277 /compiler/deSugar/DsCCall.lhs | |
parent | 53191d55079529dd3682a66e86f2ab9f6479f1bb (diff) | |
download | haskell-5b988961338f73af5790bfd365ca79c858249cea.tar.gz |
Handle newtypes and type functions correctly in FFI types; fixes #3008
You can now use type functions in FFI types.
Newtypes are now only looked through if the constructor is in scope.
Diffstat (limited to 'compiler/deSugar/DsCCall.lhs')
-rw-r--r-- | compiler/deSugar/DsCCall.lhs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/deSugar/DsCCall.lhs b/compiler/deSugar/DsCCall.lhs index a40d454852..f926f53a08 100644 --- a/compiler/deSugar/DsCCall.lhs +++ b/compiler/deSugar/DsCCall.lhs @@ -209,7 +209,7 @@ boxResult :: Type -- State# RealWorld -> (# State# RealWorld #) boxResult result_ty - | Just (io_tycon, io_res_ty, co) <- tcSplitIOType_maybe result_ty + | Just (io_tycon, io_res_ty) <- tcSplitIOType_maybe result_ty -- isIOType_maybe handles the case where the type is a -- simple wrapping of IO. E.g. -- newtype Wrap a = W (IO a) @@ -236,7 +236,7 @@ boxResult result_ty ; let io_data_con = head (tyConDataCons io_tycon) toIOCon = dataConWrapId io_data_con - wrap the_call = mkCoerce (mkSymCo co) $ + wrap the_call = mkApps (Var toIOCon) [ Type io_res_ty, Lam state_id $ |