Commit ef39af72 authored by Richard Eisenberg's avatar Richard Eisenberg
Browse files

Don't tidy vars when dumping a type

This makes variables print more consistenty in, say,
-ddump-tc-trace.
parent 9a549756
......@@ -137,8 +137,8 @@ import {-# SOURCE #-} DataCon( dataConFullSig
, dataConUnivTyVarBinders, dataConExTyVarBinders
, DataCon, filterEqSpec )
import {-# SOURCE #-} Type( isPredTy, isCoercionTy, mkAppTy, mkCastTy
, tyCoVarsOfTypesWellScoped
, tyCoVarsOfTypeWellScoped
, tyCoVarsOfTypesWellScoped
, coreView, typeKind )
-- Transitively pulls in a LOT of stuff, better to break the loop
......@@ -2445,7 +2445,7 @@ pprType = pprPrecType TopPrec
pprParendType = pprPrecType TyConPrec
pprPrecType :: TyPrec -> Type -> SDoc
pprPrecType prec ty = pprPrecIfaceType prec (tidyToIfaceType ty)
pprPrecType prec ty = getPprStyle $ \sty -> pprPrecIfaceType prec (tidyToIfaceTypeSty ty sty)
pprTyLit :: TyLit -> SDoc
pprTyLit = pprIfaceTyLit . toIfaceTyLit
......@@ -2454,6 +2454,12 @@ pprKind, pprParendKind :: Kind -> SDoc
pprKind = pprType
pprParendKind = pprParendType
tidyToIfaceTypeSty :: Type -> PprStyle -> IfaceType
tidyToIfaceTypeSty ty sty
| userStyle sty = tidyToIfaceType ty
| otherwise = toIfaceTypeX (tyCoVarsOfType ty) ty
-- in latter case, don't tidy, as we'll be printing uniques.
tidyToIfaceType :: Type -> IfaceType
-- It's vital to tidy before converting to an IfaceType
-- or nested binders will become indistinguishable!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment