Skip to content

Commit

Permalink
Fix a long-standing latent bug (and the build): check res_ty not sig_ty
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpj@microsoft.com committed Mar 4, 2009
1 parent 43213e9 commit 25a327c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions compiler/typecheck/TcForeign.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ tcCheckFIType _ arg_tys res_ty (DNImport spec) = do
_ -> return ()
return (DNImport (withDNTypes spec (map toDNType arg_tys) (toDNType res_ty)))
tcCheckFIType sig_ty _ _ idecl@(CImport _ _ _ _ (CLabel _)) = do
checkCg checkCOrAsm
check (isFFILabelTy sig_ty) (illegalForeignTyErr empty sig_ty)
return idecl
tcCheckFIType sig_ty arg_tys res_ty idecl@(CImport _ _ _ _ (CLabel _))
= ASSERT( null arg_tys )
do { checkCg checkCOrAsm
; check (isFFILabelTy res_ty) (illegalForeignTyErr empty sig_ty)
; return idecl } -- NB check res_ty not sig_ty!
-- In case sig_ty is (forall a. ForeignPtr a)
tcCheckFIType sig_ty arg_tys res_ty idecl@(CImport cconv _ _ _ CWrapper) = do
-- Foreign wrapper (former f.e.d.)
Expand Down

0 comments on commit 25a327c

Please sign in to comment.