diff options
author | Baldur Blöndal <baldurpet@gmail.com> | 2020-05-03 10:43:14 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-04 01:57:36 -0400 |
commit | 0bf640b19d7a7ad0800152752a71c1dd4e6c696d (patch) | |
tree | ad8752d12261517520765da174f95a68e81f3bcc /testsuite/tests/parser/should_fail | |
parent | 8bdc03d61cb7a2f96887c86bd0b253f7c108fcde (diff) | |
download | haskell-0bf640b19d7a7ad0800152752a71c1dd4e6c696d.tar.gz |
Don't require parentheses around via type (`-XDerivingVia'). Fixes #18130".
Diffstat (limited to 'testsuite/tests/parser/should_fail')
-rw-r--r-- | testsuite/tests/parser/should_fail/T18130Fail.hs | 20 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/T18130Fail.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/all.T | 1 |
3 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_fail/T18130Fail.hs b/testsuite/tests/parser/should_fail/T18130Fail.hs new file mode 100644 index 0000000000..dfd1389b80 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T18130Fail.hs @@ -0,0 +1,20 @@ +{-# Language DerivingVia #-} +{-# Language KindSignatures #-} + +module T18130Fail where + +import Data.Functor.Classes +import Data.Kind + +newtype Par a b = Par (a, b) + deriving Eq + via (a, b) + :: Type -> Type + + deriving Eq1 + via (,) a + :: Type -> Type + + deriving Eq2 + via (,) + :: Type -> Type -> Type diff --git a/testsuite/tests/parser/should_fail/T18130Fail.stderr b/testsuite/tests/parser/should_fail/T18130Fail.stderr new file mode 100644 index 0000000000..60887b0799 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T18130Fail.stderr @@ -0,0 +1,4 @@ + +T18130Fail.hs:11:7: error: + • Expected kind ‘* -> *’, but ‘(a, b)’ has kind ‘*’ + • In the newtype declaration for ‘Par’ diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index c6d691bed3..9d71019f3e 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -166,3 +166,4 @@ test('T17162', normal, compile_fail, ['']) test('proposal-229c', normal, compile_fail, ['']) test('T15730', normal, compile_fail, ['']) test('T15730b', normal, compile_fail, ['']) +test('T18130Fail', normal, compile_fail, ['']) |