From: simonmar Date: Thu, 6 Jan 2005 16:59:22 +0000 (+0000) Subject: [project @ 2005-01-06 16:59:22 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~1285 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=3873f299680352d90710d887a6dfdb2c78bb13a0;p=ghc-hetmet.git [project @ 2005-01-06 16:59:22 by simonmar] lookupFixityRn: we should be using loadHomeInterface rather than loadSrcInterface here, because this is a system-ish import rather than an explicit user import. In particular, loadSrcInterface will complain if the module in question is hidden, but this is not what we want. --- diff --git a/ghc/compiler/rename/RnEnv.lhs b/ghc/compiler/rename/RnEnv.lhs index 710bd6e..7596138 100644 --- a/ghc/compiler/rename/RnEnv.lhs +++ b/ghc/compiler/rename/RnEnv.lhs @@ -30,7 +30,7 @@ module RnEnv ( #include "HsVersions.h" -import LoadIface ( loadSrcInterface ) +import LoadIface ( loadHomeInterface, loadSrcInterface ) import IfaceEnv ( lookupOrig, newGlobalBinder, newIPName ) import HsSyn import RdrHsSyn ( extractHsTyRdrTyVars ) @@ -338,6 +338,8 @@ lookupQualifiedName rdr_name mod = rdrNameModule rdr_name occ = rdrNameOcc rdr_name in + -- Note: we want to behave as we would for a source file import here, + -- and respect hiddenness of modules/packages, hence loadSrcInterface. loadSrcInterface doc mod False `thenM` \ iface -> case [ (mod,occ) | @@ -423,11 +425,13 @@ lookupFixityRn name -- nothing from B will be used). When we come across a use of -- 'f', we need to know its fixity, and it's then, and only -- then, that we load B.hi. That is what's happening here. - loadSrcInterface doc name_mod False `thenM` \ iface -> + -- + -- loadHomeInterface will find B.hi even if B is a hidden module, + -- and that's what we want. + initIfaceTcRn (loadHomeInterface doc name) `thenM` \ iface -> returnM (mi_fix_fn iface (nameOccName name)) where doc = ptext SLIT("Checking fixity for") <+> ppr name - name_mod = nameModule name dataTcOccs :: RdrName -> [RdrName] -- If the input is a data constructor, return both it and a type