[Git][ghc/ghc][wip/andreask/bang-error] Reword error resulting from missing -XBangPatterns.
Andreas Klebinger (@AndreasK)
gitlab at gitlab.haskell.org
Tue May 28 11:06:07 UTC 2024
Andreas Klebinger pushed to branch wip/andreask/bang-error at Glasgow Haskell Compiler / GHC
Commits:
bbaebc1e by Andreas Klebinger at 2024-05-28T12:50:39+02:00
Reword error resulting from missing -XBangPatterns.
It can be the result of either a bang pattern or strict binding,
so now we say so instead of claiming it must be a bang pattern.
Fixes #21032
- - - - -
5 changed files:
- compiler/GHC/Parser/Errors/Ppr.hs
- testsuite/tests/parser/should_fail/T14588.stderr
- testsuite/tests/parser/should_fail/T16270.stderr
- testsuite/tests/parser/should_fail/T17162.stderr
- testsuite/tests/parser/should_fail/proposal-229c.stderr
Changes:
=====================================
compiler/GHC/Parser/Errors/Ppr.hs
=====================================
@@ -202,7 +202,7 @@ instance Diagnostic PsMessage where
NumUnderscore_Integral -> "Illegal underscores in integer literals"
NumUnderscore_Float -> "Illegal underscores in floating literals"
PsErrIllegalBangPattern e
- -> mkSimpleDecorated $ text "Illegal bang-pattern" $$ ppr e
+ -> mkSimpleDecorated $ text "Illegal bang-pattern or strict binding" $$ ppr e
PsErrOverloadedRecordDotInvalid
-> mkSimpleDecorated $
text "Use of OverloadedRecordDot '.' not valid ('.' isn't allowed when constructing records or in record patterns)"
=====================================
testsuite/tests/parser/should_fail/T14588.stderr
=====================================
@@ -1,6 +1,6 @@
-
T14588.hs:4:19: error: [GHC-79767]
- Illegal bang-pattern
+ Illegal bang-pattern or strict binding
!x
Suggested fix:
Perhaps you intended to use the ‘BangPatterns’ extension
+
=====================================
testsuite/tests/parser/should_fail/T16270.stderr
=====================================
@@ -1,4 +1,3 @@
-
T16270.hs:3:13: warning: [GHC-53692] [-Wdeprecated-flags (in -Wdefault)]
-Werror=missing-space-after-bang is deprecated: bang patterns can no longer be written with a space
@@ -57,7 +56,7 @@ T16270.hs:24:10: error: [GHC-36952]
to enable syntax: data T where
T16270.hs:26:12: error: [GHC-79767]
- Illegal bang-pattern
+ Illegal bang-pattern or strict binding
!i
Suggested fix:
Perhaps you intended to use the ‘BangPatterns’ extension
@@ -90,3 +89,4 @@ T16270.hs:40:7: error: [GHC-71614]
T16270.hs:46:1: error: [GHC-58481]
parse error (possibly incorrect indentation or mismatched brackets)
+
=====================================
testsuite/tests/parser/should_fail/T17162.stderr
=====================================
@@ -1,6 +1,6 @@
-
T17162.hs:7:21: error: [GHC-79767]
- Illegal bang-pattern
+ Illegal bang-pattern or strict binding
!enc
Suggested fix:
Perhaps you intended to use the ‘BangPatterns’ extension
+
=====================================
testsuite/tests/parser/should_fail/proposal-229c.stderr
=====================================
@@ -1,6 +1,6 @@
-
proposal-229c.hs:6:3: error: [GHC-79767]
- Illegal bang-pattern
+ Illegal bang-pattern or strict binding
!x
Suggested fix:
Perhaps you intended to use the ‘BangPatterns’ extension
+
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bbaebc1e0e6f6bff71528521d63daf5dbf6c3e40
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bbaebc1e0e6f6bff71528521d63daf5dbf6c3e40
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/20240528/7dd4807c/attachment-0001.html>
More information about the ghc-commits
mailing list