summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/InstEqContext3.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/indexed-types/should_compile/InstEqContext3.hs')
-rw-r--r--testsuite/tests/indexed-types/should_compile/InstEqContext3.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/InstEqContext3.hs b/testsuite/tests/indexed-types/should_compile/InstEqContext3.hs
new file mode 100644
index 0000000000..3f307f8941
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_compile/InstEqContext3.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE TypeFamilies #-}
+
+module InstEqContext where
+
+
+{- encoding of
+ - class C a | -> a
+ - with extra indirection
+ -}
+class a ~ Int => D a
+instance D Int
+
+class D a => C a
+instance C Int
+
+unC :: (C a) => a -> Int
+unC i = undefined
+
+test :: Int
+test = unC undefined