From: simonpj Date: Tue, 23 Jul 2002 14:58:16 +0000 (+0000) Subject: [project @ 2002-07-23 14:58:16 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~1812 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e0a56725a120bd0ce5807dddc0c56a1d02eb01f3;p=ghc-hetmet.git [project @ 2002-07-23 14:58:16 by simonpj] Use tcLookupId, not tcLookupGlobalId, in Inst.newMethodFromName This really only affects the behaviour with -fno-implicit-prelude *** MERGE TO STABLE BRANCH *** --- diff --git a/ghc/compiler/typecheck/Inst.lhs b/ghc/compiler/typecheck/Inst.lhs index d43651c..7cb4a7f 100644 --- a/ghc/compiler/typecheck/Inst.lhs +++ b/ghc/compiler/typecheck/Inst.lhs @@ -39,7 +39,7 @@ import TcHsSyn ( TcExpr, TcId, TypecheckedHsExpr, mkHsTyApp, mkHsDictApp, mkHsConApp, zonkId ) import TcMonad -import TcEnv ( TcIdSet, tcGetInstEnv, tcLookupId, tcLookupGlobalId ) +import TcEnv ( TcIdSet, tcGetInstEnv, tcLookupId ) import InstEnv ( InstLookupResult(..), lookupInstEnv ) import TcMType ( zonkTcType, zonkTcTypes, zonkTcPredType, zapToType, zonkTcThetaType, tcInstTyVar, tcInstType, tcInstTyVars @@ -393,7 +393,11 @@ tcInstDataCon orig data_con newMethodFromName :: InstOrigin -> TcType -> Name -> NF_TcM Inst newMethodFromName origin ty name - = tcLookupGlobalId name `thenNF_Tc` \ id -> + = tcLookupId name `thenNF_Tc` \ id -> + -- Use tcLookupId not tcLookupGlobalId; the method is almost + -- always a class op, but with -fno-implicit-prelude GHC is + -- meant to find whatever thing is in scope, and that may + -- be an ordinary function. newMethod origin id [ty] newMethod :: InstOrigin