From: simonm Date: Mon, 17 Nov 1997 13:52:56 +0000 (+0000) Subject: [project @ 1997-11-17 13:52:56 by simonm] X-Git-Tag: Approx_2487_patches~1293 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c5394ad4b67fc4b4e7450740bf0815c5d3491554;p=ghc-hetmet.git [project @ 1997-11-17 13:52:56 by simonm] Pull in the IO type for typechecking main --- diff --git a/ghc/compiler/rename/Rename.lhs b/ghc/compiler/rename/Rename.lhs index 789a06b..bd51090 100644 --- a/ghc/compiler/rename/Rename.lhs +++ b/ghc/compiler/rename/Rename.lhs @@ -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}