summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-01-20 16:04:20 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2016-01-21 10:09:43 +0000
commitb2e6350fb23403f1c88c5cfed5270d78dbdb6573 (patch)
tree28cbcce27fda6443343c1ced2067e35e2ea53243 /testsuite
parent07afe448c3a83d7239054baf9d54681ca19766b0 (diff)
downloadhaskell-b2e6350fb23403f1c88c5cfed5270d78dbdb6573.tar.gz
Strip casts in checkValidInstHead
This patch addresses Trac #11464. The fix is a bit crude (traverse the type to remove CastTys), but it's also simple. See Note [Casts during validity checking] in TcValidity
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/typecheck/should_fail/T11464.hs5
-rw-r--r--testsuite/tests/typecheck/should_fail/T11464.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
3 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T11464.hs b/testsuite/tests/typecheck/should_fail/T11464.hs
new file mode 100644
index 0000000000..88246aa6b7
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T11464.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE MagicHash, PolyKinds #-}
+
+module Foo where
+
+instance Eq (Either a)
diff --git a/testsuite/tests/typecheck/should_fail/T11464.stderr b/testsuite/tests/typecheck/should_fail/T11464.stderr
new file mode 100644
index 0000000000..f3402917b2
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T11464.stderr
@@ -0,0 +1,6 @@
+
+T11464.hs:5:14: error:
+ • Expecting one more argument to ‘Either a’
+ Expected a type, but ‘Either a’ has kind ‘* -> *’
+ • In the first argument of ‘Eq’, namely ‘Either a’
+ In the instance declaration for ‘Eq (Either a)’
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 88ab4994f1..1c4e86ec9b 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -403,3 +403,4 @@ test('T10619', normal, compile_fail, [''])
test('T11347', normal, compile_fail, [''])
test('T11356', normal, compile_fail, [''])
test('T11355', normal, compile_fail, [''])
+test('T11464', normal, compile_fail, [''])