diff options
Diffstat (limited to 'testsuite')
6 files changed, 49 insertions, 1 deletions
diff --git a/testsuite/tests/parser/should_compile/T18834a.hs b/testsuite/tests/parser/should_compile/T18834a.hs new file mode 100644 index 0000000000..7666173d20 --- /dev/null +++ b/testsuite/tests/parser/should_compile/T18834a.hs @@ -0,0 +1,8 @@ +module T18834a where + +(%) = ($) +($$) = ($) + +x = even $0 +y = even $$0 +z = even %0 diff --git a/testsuite/tests/parser/should_compile/T18834a.stderr b/testsuite/tests/parser/should_compile/T18834a.stderr new file mode 100644 index 0000000000..2fd8f5903d --- /dev/null +++ b/testsuite/tests/parser/should_compile/T18834a.stderr @@ -0,0 +1,15 @@ + +T18834a.hs:6:10: warning: [-Woperator-whitespace-ext-conflict (in -Wdefault)] + The prefix use of a ‘$’ would denote an untyped splice + were the TemplateHaskell extension enabled. + Suggested fix: add whitespace after the ‘$’. + +T18834a.hs:7:10: warning: [-Woperator-whitespace-ext-conflict (in -Wdefault)] + The prefix use of a ‘$$’ would denote a typed splice + were the TemplateHaskell extension enabled. + Suggested fix: add whitespace after the ‘$$’. + +T18834a.hs:8:10: warning: [-Woperator-whitespace-ext-conflict (in -Wdefault)] + The prefix use of a ‘%’ would denote a multiplicity annotation + were the LinearTypes extension enabled. + Suggested fix: add whitespace after the ‘%’. diff --git a/testsuite/tests/parser/should_compile/T18834b.hs b/testsuite/tests/parser/should_compile/T18834b.hs new file mode 100644 index 0000000000..8a020b8b5f --- /dev/null +++ b/testsuite/tests/parser/should_compile/T18834b.hs @@ -0,0 +1,8 @@ +{-# OPTIONS -Woperator-whitespace #-} + +module T18834b where + +f a b = a+ b +g a b = a +b +h a b = a+b +k a b = a + b -- this one is OK, no warning diff --git a/testsuite/tests/parser/should_compile/T18834b.stderr b/testsuite/tests/parser/should_compile/T18834b.stderr new file mode 100644 index 0000000000..9ec4f81bb4 --- /dev/null +++ b/testsuite/tests/parser/should_compile/T18834b.stderr @@ -0,0 +1,15 @@ + +T18834b.hs:5:10: warning: [-Woperator-whitespace] + The suffix use of a ‘+’ might be repurposed as special syntax + by a future language extension. + Suggested fix: add whitespace around it. + +T18834b.hs:6:11: warning: [-Woperator-whitespace] + The prefix use of a ‘+’ might be repurposed as special syntax + by a future language extension. + Suggested fix: add whitespace around it. + +T18834b.hs:7:10: warning: [-Woperator-whitespace] + The tight infix use of a ‘+’ might be repurposed as special syntax + by a future language extension. + Suggested fix: add whitespace around it. diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T index 48e1136daa..f63a3f95d9 100644 --- a/testsuite/tests/parser/should_compile/all.T +++ b/testsuite/tests/parser/should_compile/all.T @@ -170,3 +170,5 @@ test('proposal-229f', test('T15730a', normal, compile_and_run, ['']) test('T18130', normal, compile, ['']) +test('T18834a', normal, compile, ['']) +test('T18834b', normal, compile, ['']) diff --git a/testsuite/tests/typecheck/should_compile/T16312.hs b/testsuite/tests/typecheck/should_compile/T16312.hs index 1823d98558..a18f38df61 100644 --- a/testsuite/tests/typecheck/should_compile/T16312.hs +++ b/testsuite/tests/typecheck/should_compile/T16312.hs @@ -9,6 +9,6 @@ instance Functor g => Functor (Curried g h) where fmap f (Curried g) = Curried (g . fmap (.f)) instance (Functor g, g ~ h) => Applicative (Curried g h) where - pure a = Curried (fmap ($a)) + pure a = Curried (fmap ($ a)) Curried mf <*> Curried ma = Curried (ma . mf . fmap (.)) {-# INLINE (<*>) #-} |