summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/CuskFam.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/polykinds/CuskFam.hs')
-rw-r--r--testsuite/tests/polykinds/CuskFam.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/polykinds/CuskFam.hs b/testsuite/tests/polykinds/CuskFam.hs
new file mode 100644
index 0000000000..c339dbcac0
--- /dev/null
+++ b/testsuite/tests/polykinds/CuskFam.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE TypeFamilies, PolyKinds, DataKinds #-}
+-- {-# LANGUAGE CUSKs #-} -- enabled by default
+
+module CuskFam where
+
+type family F a -- non-injective
+
+type family X :: F a
+ -- Used to fail with:
+ --
+ -- • Couldn't match expected kind ‘F a1’ with actual kind ‘F a’
+ -- NB: ‘F’ is a non-injective type family
+ -- The type variable ‘a1’ is ambiguous
+ -- • In the type family declaration for ‘X’
+ --
+ -- See Note [Unifying implicit CUSK variables] in TcHsType