[Git][ghc/ghc][master] Do not color the diagnostic code in error messages (#24172)
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Fri Dec 29 20:36:53 UTC 2023
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
19328a8c by Xiaoyan Ren at 2023-12-29T15:36:30-05:00
Do not color the diagnostic code in error messages (#24172)
- - - - -
5 changed files:
- compiler/GHC/Types/Error.hs
- + testsuite/tests/ghc-e/should_fail/T24172.hs
- + testsuite/tests/ghc-e/should_fail/T24172.stderr
- testsuite/tests/ghc-e/should_fail/all.T
- testsuite/tests/warnings/should_fail/Colour.stderr
Changes:
=====================================
compiler/GHC/Types/Error.hs
=====================================
@@ -659,7 +659,7 @@ mkLocMessageWarningGroups show_warn_groups msg_class locn msg
code_doc =
case msg_class of
- MCDiagnostic _ _ (Just code) -> brackets (coloured msg_colour $ ppr_with_hyperlink code)
+ MCDiagnostic _ _ (Just code) -> brackets (ppr_with_hyperlink code)
_ -> empty
flag_msg :: Severity -> DiagnosticReason -> Maybe SDoc
=====================================
testsuite/tests/ghc-e/should_fail/T24172.hs
=====================================
@@ -0,0 +1 @@
+main = print $ 1 + Bool
=====================================
testsuite/tests/ghc-e/should_fail/T24172.stderr
=====================================
@@ -0,0 +1,8 @@
+
+[;1mT24172.hs:1:20: [;1m[31merror[0m[0m[;1m: [GHC-01928][0m[0m[;1m
+ • Illegal term-level use of the type constructor ‘Bool’
+ • imported from ‘Prelude’ at T24172.hs:1:1
+ (and originally defined in ‘GHC.Types’)
+ • In the second argument of ‘(+)’, namely ‘Bool’
+ In the second argument of ‘($)’, namely ‘1 + Bool’
+ In the expression: print $ 1 + Bool[0m[0m
=====================================
testsuite/tests/ghc-e/should_fail/all.T
=====================================
@@ -56,3 +56,5 @@ test('T18441fail18', req_interp, makefile_test, ['T18441fail18'])
test('T18441fail19', [ignore_stderr, exit_code(1)], run_command, ['{compiler} -e ":cd abcd"'])
test('T23663', req_interp, makefile_test, ['T23663'])
+
+test('T24172', normal, compile_fail, ['-fdiagnostics-color=always'])
=====================================
testsuite/tests/warnings/should_fail/Colour.stderr
=====================================
@@ -1,5 +1,5 @@
-[;1mColour.hs:1:8: [;1m[31merror[0m[0m[;1m: [[;1m[31mGHC-83865[0m[0m[;1m][0m[0m[;1m
+[;1mColour.hs:1:8: [;1m[31merror[0m[0m[;1m: [GHC-83865][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
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/19328a8c38a4d55af7d35fcd16debe2e8b474781
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/19328a8c38a4d55af7d35fcd16debe2e8b474781
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231229/93825548/attachment-0001.html>
More information about the ghc-commits
mailing list