diff options
author | Kinokkory <y.skm24t@gmail.com> | 2015-04-03 00:47:15 -0500 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2015-04-03 00:47:56 -0500 |
commit | 012ea0b96cc041bced4565d74bef7ccb75f1af0d (patch) | |
tree | 03cd0f71b2d8909805dbfee2e3f0e896f47230dc /testsuite/tests/parser | |
parent | 59f7a7b6091e9c0564f3f370d09398d8c9cd8ad5 (diff) | |
download | haskell-012ea0b96cc041bced4565d74bef7ccb75f1af0d.tar.gz |
parser: allow type-level cons in prefix position
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D768
GHC Trac Issues: #10188
Diffstat (limited to 'testsuite/tests/parser')
-rw-r--r-- | testsuite/tests/parser/should_compile/T10188.hs | 13 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/all.T | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_compile/T10188.hs b/testsuite/tests/parser/should_compile/T10188.hs new file mode 100644 index 0000000000..f12a197633 --- /dev/null +++ b/testsuite/tests/parser/should_compile/T10188.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE DataKinds, PolyKinds, TypeOperators, TypeFamilies #-} + +module T10188 where + +data Peano = Zero | Succ Peano + +type family Length (as :: [k]) :: Peano where + Length (a : as) = Succ (Length as) + Length '[] = Zero + +type family Length' (as :: [k]) :: Peano where + Length' ((:) a as) = Succ (Length' as) + Length' '[] = Zero diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T index 6eb593a94c..9e7612c967 100644 --- a/testsuite/tests/parser/should_compile/all.T +++ b/testsuite/tests/parser/should_compile/all.T @@ -100,3 +100,4 @@ test('RdrNoStaticPointers01', when(compiler_lt('ghc', '7.9'), skip), compile, [' test('T5682', normal, compile, ['']) test('T9723a', normal, compile, ['']) test('T9723b', normal, compile, ['']) +test('T10188', normal, compile, ['']) |