summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/T3460.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/indexed-types/should_compile/T3460.hs')
-rw-r--r--testsuite/tests/indexed-types/should_compile/T3460.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T3460.hs b/testsuite/tests/indexed-types/should_compile/T3460.hs
new file mode 100644
index 0000000000..ea4f59cd6b
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_compile/T3460.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE TypeFamilies, FlexibleContexts #-}
+module T3460 where
+
+class Nat n where
+ toInt :: n -> Int
+
+class (Nat (Arity f)) => Model f where
+ type Arity f
+
+ok :: Model f => f -> Arity f -> Int
+ok _ n = toInt n
+
+bug :: (Model f, Arity f ~ n) => f -> n -> Int
+bug _ n = toInt n