diff options
-rw-r--r-- | compiler/typecheck/TcRnMonad.hs | 14 | ||||
-rw-r--r-- | testsuite/tests/indexed-types/should_fail/T8129.stdout | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs index d3ae05861b..b958cf8306 100644 --- a/compiler/typecheck/TcRnMonad.hs +++ b/compiler/typecheck/TcRnMonad.hs @@ -662,18 +662,18 @@ updTcRef ref fn = liftIO $ do { old <- readIORef ref -- Typechecker trace traceTc :: String -> SDoc -> TcRn () traceTc = - guardedTraceOptTcRn Opt_D_dump_tc_trace + labelledTraceOptTcRn Opt_D_dump_tc_trace -- Renamer Trace traceRn :: String -> SDoc -> TcRn () traceRn = - guardedTraceOptTcRn Opt_D_dump_rn_trace + labelledTraceOptTcRn Opt_D_dump_rn_trace --- | Do not display a trace if `-dno-debug-output` is on -guardedTraceOptTcRn :: DumpFlag -> String -> SDoc -> TcRn () -guardedTraceOptTcRn flag herald doc = do - unless opt_NoDebugOutput - ( traceOptTcRn flag (formatTraceMsg herald doc) ) +-- | Trace when a certain flag is enabled. This is like `traceOptTcRn` +-- but accepts a string as a label and formats the trace message uniformly. +labelledTraceOptTcRn :: DumpFlag -> String -> SDoc -> TcRn () +labelledTraceOptTcRn flag herald doc = do + traceOptTcRn flag (formatTraceMsg herald doc) formatTraceMsg :: String -> SDoc -> SDoc formatTraceMsg herald doc = hang (text herald) 2 doc diff --git a/testsuite/tests/indexed-types/should_fail/T8129.stdout b/testsuite/tests/indexed-types/should_fail/T8129.stdout index bffa3dae0b..f2bab63c9e 100644 --- a/testsuite/tests/indexed-types/should_fail/T8129.stdout +++ b/testsuite/tests/indexed-types/should_fail/T8129.stdout @@ -1 +1,3 @@ • Could not deduce (C x0 (F x0)) + • Could not deduce (C x0 (F x0)) + • Could not deduce (C x0 (F x0)) |