From c5394ad4b67fc4b4e7450740bf0815c5d3491554 Mon Sep 17 00:00:00 2001 From: simonm Date: Mon, 17 Nov 1997 13:52:56 +0000 Subject: [PATCH] [project @ 1997-11-17 13:52:56 by simonm] Pull in the IO type for typechecking main --- ghc/compiler/rename/Rename.lhs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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} -- 1.7.10.4