diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-17 15:32:32 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-01 10:37:39 -0400 |
commit | f8386c7b6a9d26bc5fd2c1d74d944c8df6337690 (patch) | |
tree | 2160d6880a430f07f4a0ac7a58b0355afe139649 /compiler/GHC/Tc | |
parent | 780de9e11014a88a4f676eb296c30fec2b07b5c2 (diff) | |
download | haskell-f8386c7b6a9d26bc5fd2c1d74d944c8df6337690.tar.gz |
Refactor PprDebug handling
If `-dppr-debug` is set, then PprUser and PprDump styles are silently
replaced with PprDebug style. This was done in `mkUserStyle` and
`mkDumpStyle` smart constructors. As a consequence they needed a
DynFlags parameter.
Now we keep the original PprUser and PprDump styles until they are used
to create an `SDocContext`. I.e. the substitution is only performed in
`initSDocContext`.
Diffstat (limited to 'compiler/GHC/Tc')
-rw-r--r-- | compiler/GHC/Tc/Utils/Monad.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Tc/Utils/Monad.hs b/compiler/GHC/Tc/Utils/Monad.hs index b256be47f2..6e21326f62 100644 --- a/compiler/GHC/Tc/Utils/Monad.hs +++ b/compiler/GHC/Tc/Utils/Monad.hs @@ -712,8 +712,8 @@ dumpTcRn useUserStyle dumpOpt title fmt doc = do printer <- getPrintUnqualified dflags real_doc <- wrapDocLoc doc let sty = if useUserStyle - then mkUserStyle dflags printer AllTheWay - else mkDumpStyle dflags printer + then mkUserStyle printer AllTheWay + else mkDumpStyle printer liftIO $ dumpAction dflags sty dumpOpt title fmt real_doc -- | Add current location if -dppr-debug |