summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail')
-rw-r--r--testsuite/tests/typecheck/should_fail/ExplicitSpecificity4.hs10
-rw-r--r--testsuite/tests/typecheck/should_fail/T18455.hs7
-rw-r--r--testsuite/tests/typecheck/should_fail/T18455.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T2
4 files changed, 12 insertions, 11 deletions
diff --git a/testsuite/tests/typecheck/should_fail/ExplicitSpecificity4.hs b/testsuite/tests/typecheck/should_fail/ExplicitSpecificity4.hs
deleted file mode 100644
index 4d615631b6..0000000000
--- a/testsuite/tests/typecheck/should_fail/ExplicitSpecificity4.hs
+++ /dev/null
@@ -1,10 +0,0 @@
-{-# LANGUAGE DefaultSignatures #-}
-{-# LANGUAGE ScopedTypeVariables #-}
-
-module ExplicitSpecificity4 where
-
-class C a where
- f :: forall {z}. z -> a -> a
- default f :: forall {z}. z -> a -> a
- f _ x = x
-
diff --git a/testsuite/tests/typecheck/should_fail/T18455.hs b/testsuite/tests/typecheck/should_fail/T18455.hs
new file mode 100644
index 0000000000..ad151ae9a7
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T18455.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE RankNTypes #-}
+module T18455 where
+
+class C a
+
+instance C (Either a b) where
+ {-# SPECIALISE instance forall a. forall b. C (Either a b) #-}
diff --git a/testsuite/tests/typecheck/should_fail/T18455.stderr b/testsuite/tests/typecheck/should_fail/T18455.stderr
new file mode 100644
index 0000000000..15d02d1902
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T18455.stderr
@@ -0,0 +1,4 @@
+
+T18455.hs:7:37: error:
+ SPECIALISE instance type cannot contain nested ‘forall’s or contexts
+ In a SPECIALISE instance pragma
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index c9b785554e..7b4d6d1899 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -568,7 +568,6 @@ test('T18127a', normal, compile_fail, [''])
test('ExplicitSpecificity1', normal, compile_fail, [''])
test('ExplicitSpecificity2', normal, compile_fail, [''])
test('ExplicitSpecificity3', normal, compile_fail, [''])
-test('ExplicitSpecificity4', normal, compile_fail, [''])
test('ExplicitSpecificity5', normal, compile_fail, [''])
test('ExplicitSpecificity6', normal, compile_fail, [''])
test('ExplicitSpecificity7', normal, compile_fail, [''])
@@ -578,3 +577,4 @@ test('ExplicitSpecificity10', normal, compile_fail, [''])
test('T18357', normal, compile_fail, [''])
test('T18357a', normal, compile_fail, [''])
test('T18357b', normal, compile_fail, [''])
+test('T18455', normal, compile_fail, [''])