X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcRnTypes.lhs;h=28bfd8ecb72a8d7c3e35335f1263367334ca1868;hp=ff8e3d630752d5b52bed1302b2a9010029acb082;hb=c04a5fe3e2867d59ce9757069fdd20c06c326724;hpb=6a104dcf597f27887f0f1ac82dba7051ed2fe0c3 diff --git a/compiler/typecheck/TcRnTypes.lhs b/compiler/typecheck/TcRnTypes.lhs index ff8e3d6..28bfd8e 100644 --- a/compiler/typecheck/TcRnTypes.lhs +++ b/compiler/typecheck/TcRnTypes.lhs @@ -29,7 +29,7 @@ module TcRnTypes( -- 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, @@ -868,6 +868,9 @@ data InstLoc = InstLoc InstOrigin SrcSpan ErrCtxt 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) @@ -912,7 +915,13 @@ data InstOrigin | 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 @@ -936,6 +945,7 @@ instance Outputable InstOrigin where 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")