diff options
-rw-r--r-- | compiler/GHC/Utils/Logger.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/warnings/should_fail/Colour.hs | 1 | ||||
-rw-r--r-- | testsuite/tests/warnings/should_fail/Colour.stderr | 5 | ||||
-rw-r--r-- | testsuite/tests/warnings/should_fail/all.T | 1 |
4 files changed, 8 insertions, 1 deletions
diff --git a/compiler/GHC/Utils/Logger.hs b/compiler/GHC/Utils/Logger.hs index bf480b8394..48601dd655 100644 --- a/compiler/GHC/Utils/Logger.hs +++ b/compiler/GHC/Utils/Logger.hs @@ -402,7 +402,7 @@ defaultLogActionHPutStrDoc :: LogFlags -> Bool -> Handle -> SDoc -> IO () defaultLogActionHPutStrDoc logflags asciiSpace h d -- Don't add a newline at the end, so that successive -- calls to this log-action can output all on the same line - = printSDoc (log_default_dump_context logflags) (Pretty.PageMode asciiSpace) h d + = printSDoc (log_default_user_context logflags) (Pretty.PageMode asciiSpace) h d -- -- Note [JSON Error Messages] diff --git a/testsuite/tests/warnings/should_fail/Colour.hs b/testsuite/tests/warnings/should_fail/Colour.hs new file mode 100644 index 0000000000..983f291160 --- /dev/null +++ b/testsuite/tests/warnings/should_fail/Colour.hs @@ -0,0 +1 @@ +main = () :: IO () diff --git a/testsuite/tests/warnings/should_fail/Colour.stderr b/testsuite/tests/warnings/should_fail/Colour.stderr new file mode 100644 index 0000000000..8631313a7b --- /dev/null +++ b/testsuite/tests/warnings/should_fail/Colour.stderr @@ -0,0 +1,5 @@ + +[;1mColour.hs:1:8: [;1m[31merror:[0m[0m[;1m[0m[0m[;1m + • Couldn't match expected type ‘IO ()’ with actual type ‘()’ + • In the expression: () :: IO () + In an equation for ‘main’: main = () :: IO ()[0m[0m diff --git a/testsuite/tests/warnings/should_fail/all.T b/testsuite/tests/warnings/should_fail/all.T index 7d0dc4295f..075c790222 100644 --- a/testsuite/tests/warnings/should_fail/all.T +++ b/testsuite/tests/warnings/should_fail/all.T @@ -15,3 +15,4 @@ test('CaretDiagnostics1', compile_fail, ['-fdiagnostics-show-caret -ferror-spans']) test('CaretDiagnostics2', normal, compile_fail, ['-fdiagnostics-show-caret']) +test('Colour', normal, compile_fail, ['-fdiagnostics-color=always']) |