diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/gadt/T22235.hs | 23 | ||||
-rw-r--r-- | testsuite/tests/gadt/all.T | 1 |
2 files changed, 24 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 diff --git a/testsuite/tests/gadt/all.T b/testsuite/tests/gadt/all.T index ce30d570f3..1b32762525 100644 --- a/testsuite/tests/gadt/all.T +++ b/testsuite/tests/gadt/all.T @@ -125,3 +125,4 @@ test('T20278', normal, compile, ['']) test('SynDataRec', normal, compile, ['']) test('T20485', normal, compile, ['']) test('T20485a', normal, compile, ['']) +test('T22235', normal, compile, ['']) |