summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/T3017.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/indexed-types/should_compile/T3017.hs')
-rw-r--r--testsuite/tests/indexed-types/should_compile/T3017.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T3017.hs b/testsuite/tests/indexed-types/should_compile/T3017.hs
new file mode 100644
index 0000000000..8e4e5bd999
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_compile/T3017.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE TypeFamilies #-}
+
+-- Trac #3017
+
+module Foo where
+ class Coll c where
+ type Elem c
+ empty :: c
+ insert :: Elem c -> c -> c
+
+ data ListColl a = L [a]
+ instance Coll (ListColl a) where
+ type Elem (ListColl a) = a
+ empty = L []
+ insert x (L xs) = L (x:xs)
+
+ emptyL :: ListColl a
+ emptyL = empty
+
+ test2 c = insert (0, 0) c