-- Insts
Inst(..), EqInstCo, InstOrigin(..), InstLoc(..),
- pprInstLoc, pprInstArising, instLocSpan, instLocOrigin,
+ pprInstLoc, pprInstArising, instLocSpan, instLocOrigin, setInstLoc,
LIE, emptyLIE, unitLIE, plusLIE, consLIE, instLoc, instSpan,
plusLIEs, mkLIE, isEmptyLIE, lieToList, listToLIE,
instLoc :: Inst -> InstLoc
instLoc inst = tci_loc inst
+setInstLoc :: Inst -> InstLoc -> Inst
+setInstLoc inst new_loc = inst { tci_loc = new_loc }
+
instSpan :: Inst -> SrcSpan
instSpan wanted = instLocSpan (instLoc wanted)
| ExprSigOrigin -- e :: ty
| RecordUpdOrigin
| ViewPatOrigin
+
| InstScOrigin -- Typechecking superclasses of an instance declaration
+
+ | NoScOrigin -- A very special hack; see TcSimplify,
+ -- Note [Recursive instances and superclases]
+
+
| DerivOrigin -- Typechecking deriving
| StandAloneDerivOrigin -- Typechecking stand-alone deriving
| DefaultOrigin -- Typechecking a default decl
ppr TupleOrigin = ptext (sLit "a tuple")
ppr NegateOrigin = ptext (sLit "a use of syntactic negation")
ppr InstScOrigin = ptext (sLit "the superclasses of an instance declaration")
+ ppr NoScOrigin = ptext (sLit "an instance declaration")
ppr DerivOrigin = ptext (sLit "the 'deriving' clause of a data type declaration")
ppr StandAloneDerivOrigin = ptext (sLit "a 'deriving' declaration")
ppr DefaultOrigin = ptext (sLit "a 'default' declaration")