From e0a56725a120bd0ce5807dddc0c56a1d02eb01f3 Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 23 Jul 2002 14:58:16 +0000 Subject: [PATCH] [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 *** --- ghc/compiler/typecheck/Inst.lhs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 1.7.10.4