Skip to content
Snippets Groups Projects
Commit c5394ad4 authored by Simon Marlow's avatar Simon Marlow
Browse files

[project @ 1997-11-17 13:52:56 by simonm]

Pull in the IO type for typechecking main
parent 6ea9ce88
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,7 @@ import Name ( Name, Provenance, ExportFlag(..), isLocallyDefined,
import TysWiredIn ( unitTyCon, intTyCon, doubleTyCon )
import TyCon ( TyCon )
import PrelMods ( mAIN, gHC_MAIN )
import PrelInfo ( ioTyCon_NAME )
import ErrUtils ( SYN_IE(Error), SYN_IE(Warning), pprBagOfErrors,
doIfSet, dumpIfSet, ghcExit
)
......@@ -171,13 +172,18 @@ mentioned explicitly, but which might be needed by the type checker.
\begin{code}
addImplicits mod_name
= addImplicitOccsRn default_tys
= addImplicitOccsRn (implicit_main ++ default_tys)
where
-- Add occurrences for Int, Double, and (), because they
-- are the types to which ambigious type variables may be defaulted by
-- the type checker; so they won't every appear explicitly.
-- [The () one is a GHC extension for defaulting CCall results.]
default_tys = [getName intTyCon, getName doubleTyCon, getName unitTyCon ]
-- Add occurrences for IO or PrimIO
implicit_main | mod_name == mAIN
|| mod_name == gHC_MAIN = [ioTyCon_NAME]
| otherwise = []
\end{code}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment