summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2022-12-20 15:52:47 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-12-22 23:41:07 -0500
commit317f45c154f6fe25d50ef2f3febcc5883ff1b1ca (patch)
tree0b9c77e0ff666dce088f29c51c309d54dbd3f381 /testsuite/tests
parent35267f077ac226d4fbe3f14fce2dd240fb61e188 (diff)
downloadhaskell-317f45c154f6fe25d50ef2f3febcc5883ff1b1ca.tar.gz
Fix unifier bug: failing to decompose over-saturated type family
This simple patch fixes #22647
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/typecheck/should_compile/T22647.hs21
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
2 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T22647.hs b/testsuite/tests/typecheck/should_compile/T22647.hs
new file mode 100644
index 0000000000..10cf5a98e8
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T22647.hs
@@ -0,0 +1,21 @@
+{-# LANGUAGE TypeApplications, KindSignatures, DataKinds, TypeFamilies, FlexibleInstances #-}
+
+module T22647 where
+
+import Data.Kind
+
+data D = D
+type family F :: D -> Type
+
+class C f where
+ meth :: f
+
+instance C (f (p :: D)) where -- f :: D -> Type
+ meth = error "urk1"
+
+instance C (g (q :: Type)) where -- g :: Type -> Type
+ meth = error "urk2"
+
+x = meth :: F 'D
+
+y = meth :: [Type]
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 1f1e7d8d1f..577ce86d65 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -853,3 +853,4 @@ test('T21550', normal, compile, [''])
test('T22310', normal, compile, [''])
test('T22331', normal, compile, [''])
test('T22516', normal, compile, [''])
+test('T22647', normal, compile, [''])