summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T8566a.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/polykinds/T8566a.hs')
-rw-r--r--testsuite/tests/polykinds/T8566a.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/polykinds/T8566a.hs b/testsuite/tests/polykinds/T8566a.hs
new file mode 100644
index 0000000000..3d20c3e27d
--- /dev/null
+++ b/testsuite/tests/polykinds/T8566a.hs
@@ -0,0 +1,22 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TypeOperators #-}
+module T8566a where
+
+data Field = forall k. APP k [Field]
+
+data InField (u :: Field) :: * where
+ A :: AppVars t (ExpandField args) -> InField (APP t args)
+
+type family ExpandField (args :: [Field]) :: [*]
+type family AppVars (t :: k) (vs :: [*]) :: *
+
+-- This function fails to compile, because we discard
+-- 'given' kind equalities. See comment 7 in Trac #8566
+-- This is really a bug, I claim
+unA :: InField (APP t args) -> AppVars t (ExpandField args)
+unA (A x) = x
+