summaryrefslogtreecommitdiff
path: root/compiler/main/HscTypes.lhs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main/HscTypes.lhs')
-rw-r--r--compiler/main/HscTypes.lhs27
1 files changed, 20 insertions, 7 deletions
diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs
index 123b0777fc..9a5ad1f0a9 100644
--- a/compiler/main/HscTypes.lhs
+++ b/compiler/main/HscTypes.lhs
@@ -1003,6 +1003,9 @@ data ModGuts
mg_insts :: ![ClsInst], -- ^ Class instances declared in this module
mg_fam_insts :: ![FamInst],
-- ^ Family instances declared in this module
+ mg_axioms :: ![CoAxiom Branched],
+ -- ^ Axioms without family instances
+ -- See Note [Instance scoping for OverloadedRecordFields] in TcFldInsts
mg_patsyns :: ![PatSyn], -- ^ Pattern synonyms declared in this module
mg_rules :: ![CoreRule], -- ^ Before the core pipeline starts, contains
-- See Note [Overall plumbing for rules] in Rules.lhs
@@ -1197,12 +1200,15 @@ The ic_tythings field contains
*don't* come from 'implicitTyThings', notably:
- record selectors
- class ops
+ - DFunIds for OverloadedRecordFields classes
The implicitTyThings are readily obtained from the TyThings
but record selectors etc are not
It does *not* contain
- * DFunIds (they can be gotten from ic_instances)
- * CoAxioms (ditto)
+ * CoAxioms (they can be gotten from ic_instances)
+ * DFunIds (ditto), except for OverloadedRecordFields classes
+ (see Note [Instance scoping for OverloadedRecordFields] in TcFldInsts)
+
See also Note [Interactively-bound Ids in GHCi]
@@ -1251,6 +1257,11 @@ data InteractiveContext
-- time we update the context, we just take the results
-- from the instance code that already does that.
+ ic_axioms :: [CoAxiom Branched],
+ -- ^ Axioms created during this session without a type family
+ -- (see Note [Instance scoping for OverloadedRecordFields]
+ -- in TcFldInsts).
+
ic_fix_env :: FixityEnv,
-- ^ Fixities declared in let statements
@@ -1294,6 +1305,7 @@ emptyInteractiveContext dflags
ic_mod_index = 1,
ic_tythings = [],
ic_instances = ([],[]),
+ ic_axioms = [],
ic_fix_env = emptyNameEnv,
ic_monad = ioTyConName, -- IO monad by default
ic_int_print = printName, -- System.IO.print by default
@@ -1659,12 +1671,13 @@ tyThingAvailInfo :: TyThing -> AvailInfo
tyThingAvailInfo (ATyCon t)
= case tyConClass_maybe t of
Just c -> AvailTC n (n : map getName (classMethods c)
- ++ map getName (classATs c))
+ ++ map getName (classATs c))
+ []
where n = getName c
- Nothing -> AvailTC n (n : map getName dcs ++
- concatMap dataConFieldLabels dcs)
- where n = getName t
- dcs = tyConDataCons t
+ Nothing -> AvailTC n (n : map getName dcs) (fieldLabelsToAvailFields flds)
+ where n = getName t
+ dcs = tyConDataCons t
+ flds = tyConFieldLabels t
tyThingAvailInfo t
= Avail (getName t)
\end{code}