diff options
| author | simonpj <unknown> | 2004-03-11 14:31:35 +0000 |
|---|---|---|
| committer | simonpj <unknown> | 2004-03-11 14:31:35 +0000 |
| commit | 3cc0dcd426c329b84742676f85d50a059da24267 (patch) | |
| tree | 13dec5899c2703ad69b3e585b43e3c4223e1dfb0 /ghc/compiler/iface/TcIface.lhs | |
| parent | e059689979b84a718e3ab8d48e77825015d91702 (diff) | |
| download | haskell-3cc0dcd426c329b84742676f85d50a059da24267.tar.gz | |
[project @ 2004-03-11 14:31:35 by simonpj]
Sanity checking
Diffstat (limited to 'ghc/compiler/iface/TcIface.lhs')
| -rw-r--r-- | ghc/compiler/iface/TcIface.lhs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/ghc/compiler/iface/TcIface.lhs b/ghc/compiler/iface/TcIface.lhs index 57c40de937..244c919c59 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 |
