summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simon.peytonjones@gmail.com>2023-05-05 13:18:28 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-11 04:11:30 -0400
commit40c7daed0c971e58e86a8189f82f72e9213af8b6 (patch)
tree86626dbe410954fb6ead7ed1bde80a612d4d287e /testsuite
parent29be39ba3f187279b19cf451f2d8f58822edab4f (diff)
downloadhaskell-40c7daed0c971e58e86a8189f82f72e9213af8b6.tar.gz
Look both ways when looking for quantified equalities
When looking up (t1 ~# t2) in the quantified constraints, check both orientations. Forgetting this led to #23333.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/quantified-constraints/T23333.hs8
-rw-r--r--testsuite/tests/quantified-constraints/all.T2
2 files changed, 9 insertions, 1 deletions
diff --git a/testsuite/tests/quantified-constraints/T23333.hs b/testsuite/tests/quantified-constraints/T23333.hs
new file mode 100644
index 0000000000..c8fde6d608
--- /dev/null
+++ b/testsuite/tests/quantified-constraints/T23333.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE QuantifiedConstraints #-}
+module T23333 where
+
+foo1 :: (forall y. Bool ~ y) => z -> Bool
+foo1 x = not x
+
+foo2 :: (forall y. y ~ Bool) => z -> Bool
+foo2 x = not x
diff --git a/testsuite/tests/quantified-constraints/all.T b/testsuite/tests/quantified-constraints/all.T
index d3bfe6e07e..bea86c5e8f 100644
--- a/testsuite/tests/quantified-constraints/all.T
+++ b/testsuite/tests/quantified-constraints/all.T
@@ -41,4 +41,4 @@ test('T22216d', normal, compile, [''])
test('T22216e', normal, compile, [''])
test('T22223', normal, compile, [''])
test('T19690', normal, compile_fail, [''])
-
+test('T23333', normal, compile, [''])