summaryrefslogtreecommitdiff
path: root/testsuite/tests/gadt/T22235.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/gadt/T22235.hs')
-rw-r--r--testsuite/tests/gadt/T22235.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/gadt/T22235.hs b/testsuite/tests/gadt/T22235.hs
new file mode 100644
index 0000000000..0f4161db72
--- /dev/null
+++ b/testsuite/tests/gadt/T22235.hs
@@ -0,0 +1,23 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+module T22235 (f) where
+
+import Data.Kind (Type)
+import Data.Type.Equality ((:~:)(..))
+
+f :: ST x -> ST y -> x :~: y
+f st1@SMkT st2@SMkT = method st1 st2
+
+type T :: Type -> Type
+data T a where
+ MkT :: T Int
+
+type ST :: T a -> Type
+data ST (t :: T a) where
+ SMkT :: ST MkT
+
+class C f where
+ method :: f a -> f b -> a :~: b
+
+instance C ST where
+ method SMkT SMkT = Refl