Commit a74edc69 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com
Browse files

Layout only

parent 25a327cf
...@@ -69,22 +69,22 @@ tcForeignImports decls ...@@ -69,22 +69,22 @@ tcForeignImports decls
tcFImport :: ForeignDecl Name -> TcM (Id, ForeignDecl Id) tcFImport :: ForeignDecl Name -> TcM (Id, ForeignDecl Id)
tcFImport fo@(ForeignImport (L loc nm) hs_ty imp_decl) tcFImport fo@(ForeignImport (L loc nm) hs_ty imp_decl)
= addErrCtxt (foreignDeclCtxt fo) $ do = addErrCtxt (foreignDeclCtxt fo) $
sig_ty <- tcHsSigType (ForSigCtxt nm) hs_ty do { sig_ty <- tcHsSigType (ForSigCtxt nm) hs_ty
let ; let
-- drop the foralls before inspecting the structure -- Drop the foralls before inspecting the
-- of the foreign type. -- structure of the foreign type.
(_, t_ty) = tcSplitForAllTys sig_ty (_, t_ty) = tcSplitForAllTys sig_ty
(arg_tys, res_ty) = tcSplitFunTys t_ty (arg_tys, res_ty) = tcSplitFunTys t_ty
id = mkLocalId nm sig_ty id = mkLocalId nm sig_ty
-- Use a LocalId to obey the invariant that locally-defined -- Use a LocalId to obey the invariant that locally-defined
-- things are LocalIds. However, it does not need zonking, -- things are LocalIds. However, it does not need zonking,
-- (so TcHsSyn.zonkForeignExports ignores it). -- (so TcHsSyn.zonkForeignExports ignores it).
imp_decl' <- tcCheckFIType sig_ty arg_tys res_ty imp_decl ; imp_decl' <- tcCheckFIType sig_ty arg_tys res_ty imp_decl
-- can't use sig_ty here because it :: Type and we need HsType Id -- Can't use sig_ty here because sig_ty :: Type and
-- hence the undefined -- we need HsType Id hence the undefined
return (id, ForeignImport (L loc id) undefined imp_decl') ; return (id, ForeignImport (L loc id) undefined imp_decl') }
tcFImport d = pprPanic "tcFImport" (ppr d) tcFImport d = pprPanic "tcFImport" (ppr d)
\end{code} \end{code}
......
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