summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_fail/T2203a.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/indexed-types/should_fail/T2203a.hs')
-rw-r--r--testsuite/tests/indexed-types/should_fail/T2203a.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_fail/T2203a.hs b/testsuite/tests/indexed-types/should_fail/T2203a.hs
new file mode 100644
index 0000000000..89ed37e3da
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T2203a.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE ScopedTypeVariables, TypeFamilies, FlexibleInstances #-}
+
+module T2203a where
+
+class Foo a where
+ type TheFoo a
+ foo :: TheFoo a -> a
+ foo' :: a -> Int
+
+class Bar b where
+ bar :: b -> Int
+
+instance Foo a => Bar (Either a (TheFoo a)) where
+ bar (Left a) = foo' a
+ bar (Right b) = foo' (foo b :: a)