diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T12709.stderr | 12 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T14765.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T14765.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
4 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T12709.stderr b/testsuite/tests/typecheck/should_fail/T12709.stderr index f8da5ea120..1d3334c6f7 100644 --- a/testsuite/tests/typecheck/should_fail/T12709.stderr +++ b/testsuite/tests/typecheck/should_fail/T12709.stderr @@ -5,6 +5,18 @@ T12709.hs:28:13: error: Kind: TYPE rep In the type of expression: 1 +T12709.hs:28:13: error: + A representation-polymorphic type is not allowed here: + Type: a + Kind: TYPE rep + In the type of expression: 1 + 2 + +T12709.hs:28:13: error: + A representation-polymorphic type is not allowed here: + Type: a + Kind: TYPE rep + In the type of expression: 1 + 2 + 3 + T12709.hs:28:17: error: A representation-polymorphic type is not allowed here: Type: a diff --git a/testsuite/tests/typecheck/should_fail/T14765.hs b/testsuite/tests/typecheck/should_fail/T14765.hs new file mode 100644 index 0000000000..b124252bb4 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T14765.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE Haskell2010 #-} +{-# LANGUAGE MagicHash, PolyKinds, ExplicitForAll #-} + +module T14765 where + +import GHC.Exts + +fold :: forall rep a (r :: TYPE rep). + (r -> a -> Proxy# r -> r) -> (Proxy# r -> r) -> [a] -> r +fold f k [] = k proxy# +fold f k (x : xs) = fold f (f (k proxy#) x) xs diff --git a/testsuite/tests/typecheck/should_fail/T14765.stderr b/testsuite/tests/typecheck/should_fail/T14765.stderr new file mode 100644 index 0000000000..c837c0d717 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T14765.stderr @@ -0,0 +1,6 @@ + +T14765.hs:11:31: error: + A representation-polymorphic type is not allowed here: + Type: r + Kind: TYPE rep + In the type of expression: (k proxy#) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index b776f1d5dd..8745ea9172 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -480,6 +480,7 @@ test('T14607', normal, compile_fail, ['']) test('T14605', normal, compile_fail, ['']) test('T14761a', normal, compile_fail, ['']) test('T14761b', normal, compile_fail, ['']) +test('T14765', normal, compile_fail, ['']) test('T14884', normal, compile_fail, ['']) test('T14904a', normal, compile_fail, ['']) test('T14904b', normal, compile_fail, ['']) |