From 9431e1953b29b2fe3e383b038258877efe9f6595 Mon Sep 17 00:00:00 2001
From: Simon Peyton Jones <simon.peytonjones@gmail.com>
Date: Fri, 8 Dec 2023 10:43:03 +0000
Subject: [PATCH] Add test for #22238

---
 testsuite/tests/quantified-constraints/T22238.hs | 12 ++++++++++++
 testsuite/tests/quantified-constraints/all.T     |  1 +
 2 files changed, 13 insertions(+)
 create mode 100644 testsuite/tests/quantified-constraints/T22238.hs

diff --git a/testsuite/tests/quantified-constraints/T22238.hs b/testsuite/tests/quantified-constraints/T22238.hs
new file mode 100644
index 000000000000..6192554ede72
--- /dev/null
+++ b/testsuite/tests/quantified-constraints/T22238.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE ImpredicativeTypes #-}
+{-# LANGUAGE GADTs #-}
+
+module T22238 where
+
+import Data.Kind (Constraint)
+
+data Dict (c :: Constraint) where
+    MkDict :: c => Dict c
+
+forallListEqDict :: Dict (forall a. Eq a => Eq [a])
+forallListEqDict = MkDict
diff --git a/testsuite/tests/quantified-constraints/all.T b/testsuite/tests/quantified-constraints/all.T
index 1df950fa0e3c..c3235a48d987 100644
--- a/testsuite/tests/quantified-constraints/all.T
+++ b/testsuite/tests/quantified-constraints/all.T
@@ -44,3 +44,4 @@ test('T19690', normal, compile_fail, [''])
 test('T23143', normal, compile, [''])
 test('T23333', normal, compile, [''])
 test('T23323', normal, compile, [''])
+test('T22238', normal, compile, [''])
-- 
GitLab