summaryrefslogtreecommitdiff
path: root/testsuite/tests/quantified-constraints/T15316A.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/quantified-constraints/T15316A.hs')
-rw-r--r--testsuite/tests/quantified-constraints/T15316A.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/quantified-constraints/T15316A.hs b/testsuite/tests/quantified-constraints/T15316A.hs
new file mode 100644
index 0000000000..d48c46ed7d
--- /dev/null
+++ b/testsuite/tests/quantified-constraints/T15316A.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE RankNTypes, QuantifiedConstraints, ConstraintKinds, UndecidableInstances #-}
+
+-- Should produce a compile time "Reduction stack overflow" error
+module T15316A where
+
+import Data.Proxy
+
+class Class a where
+ method :: a
+
+subsume :: (Class a => Class b) => Proxy a -> Proxy b -> ((Class a => Class b) => r) -> r
+subsume _ _ x = x
+
+value :: Proxy a -> a
+value p = subsume p p method
+