diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2019-10-30 08:44:34 +0300 |
---|---|---|
committer | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2019-11-27 11:32:18 +0300 |
commit | 8168b42a95ddf37c56958955eef065eb8747470f (patch) | |
tree | a677a67987372dac9732ea67f6ab37a77c02641a /testsuite/tests/typecheck | |
parent | 5a08f7d405bbedfdc20c07f64726899f594e9d07 (diff) | |
download | haskell-8168b42a95ddf37c56958955eef065eb8747470f.tar.gz |
Whitespace-sensitive bang patterns (#1087, #17162)wip/whitespace-and-lookahead
This patch implements a part of GHC Proposal #229 that covers five
operators:
* the bang operator (!)
* the tilde operator (~)
* the at operator (@)
* the dollar operator ($)
* the double dollar operator ($$)
Based on surrounding whitespace, these operators are disambiguated into
bang patterns, lazy patterns, strictness annotations, type
applications, splices, and typed splices.
This patch doesn't cover the (-) operator or the -Woperator-whitespace
warning, which are left as future work.
Diffstat (limited to 'testsuite/tests/typecheck')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T14761b.stderr | 5 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T15527.stderr | 10 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T7210.stderr | 10 |
3 files changed, 14 insertions, 11 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T14761b.stderr b/testsuite/tests/typecheck/should_fail/T14761b.stderr index 08a319cde3..af557c4725 100644 --- a/testsuite/tests/typecheck/should_fail/T14761b.stderr +++ b/testsuite/tests/typecheck/should_fail/T14761b.stderr @@ -1,5 +1,2 @@ -T14761b.hs:5:21: error: - Strictness annotation applied to a compound type. - Did you mean to add parentheses? - !(Maybe Int) +T14761b.hs:5:19: error: Operator applied to too few arguments: ! diff --git a/testsuite/tests/typecheck/should_fail/T15527.stderr b/testsuite/tests/typecheck/should_fail/T15527.stderr index dd03a0a0ca..2b764caef9 100644 --- a/testsuite/tests/typecheck/should_fail/T15527.stderr +++ b/testsuite/tests/typecheck/should_fail/T15527.stderr @@ -1,4 +1,8 @@ -T15527.hs:4:6: error: - Pattern syntax in expression context: (.)@Int - Did you mean to enable TypeApplications? +T15527.hs:4:10: error: + Variable not in scope: + (@) + :: ((b0 -> c0) -> (a0 -> b0) -> a0 -> c0) + -> t0 -> (Int -> Int) -> (Int -> Int) -> Int -> Int + +T15527.hs:4:11: error: Data constructor not in scope: Int diff --git a/testsuite/tests/typecheck/should_fail/T7210.stderr b/testsuite/tests/typecheck/should_fail/T7210.stderr index 4d7cb38a4d..d0ca04a84e 100644 --- a/testsuite/tests/typecheck/should_fail/T7210.stderr +++ b/testsuite/tests/typecheck/should_fail/T7210.stderr @@ -1,5 +1,7 @@ -T7210.hs:5:20: error: - Strictness annotation applied to a compound type. - Did you mean to add parentheses? - !(IntMap Int) +T7210.hs:5:19: error: + • Unexpected strictness annotation: !IntMap + strictness annotation cannot appear nested inside a type + • In the type ‘!IntMap Int’ + In the definition of data constructor ‘C’ + In the data declaration for ‘T’ |