From 3cc0dcd426c329b84742676f85d50a059da24267 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 11 Mar 2004 14:31:35 +0000 Subject: [PATCH] [project @ 2004-03-11 14:31:35 by simonpj] Sanity checking --- ghc/compiler/iface/TcIface.lhs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ghc/compiler/iface/TcIface.lhs b/ghc/compiler/iface/TcIface.lhs index 57c40de..244c919 100644 --- a/ghc/compiler/iface/TcIface.lhs +++ b/ghc/compiler/iface/TcIface.lhs @@ -59,7 +59,7 @@ import Outputable import SrcLoc ( noSrcLoc ) import Util ( zipWithEqual, dropList, equalLength, zipLazy ) import Maybes ( expectJust ) -import CmdLineOpts ( DynFlag(..) ) +import CmdLineOpts ( DynFlag(..), dopt ) \end{code} This module takes @@ -487,11 +487,22 @@ loadImportedInsts cls tys ; eps_var <- getEpsVar ; eps <- readMutVar eps_var + -- For interest: report the no-type-constructor case. + -- Don't report when -fallow-undecidable-instances is on, because then + -- we call loadImportedInsts when looking up even predicates like (C a) + -- But without undecidable instances it's rare to see C (a b) and + -- somethat interesting +#ifdef DEBUG + ; dflags <- getDOpts + ; WARN( not (dopt Opt_AllowUndecidableInstances dflags) && null tc_gates, + ptext SLIT("Interesting! No tycons in Inst:") + <+> pprClassPred cls tys ) + return () +#endif + -- Suck in the instances ; let { (inst_pool', iface_insts) - = WARN( null tc_gates, ptext SLIT("Interesting! No tycons in Inst:") - <+> pprClassPred cls tys ) - selectInsts (eps_insts eps) cls_gate tc_gates } + = selectInsts (eps_insts eps) cls_gate tc_gates } -- Empty => finish up rapidly, without writing to eps ; if null iface_insts then -- 1.7.10.4