Commit 047d3d75 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

testsuite: Add test for #15316

This is the full testcase for T15316.
parent 545cf1e1
Pipeline #15556 passed with stages
in 493 minutes and 3 seconds
{-# 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
T15316A.hs:15:23:
Reduction stack overflow; size = 201
When simplifying the following type: Class a
Use -freduction-depth=0 to disable this check
(any upper bound you could choose might fail unpredictably with
minor updates to GHC, so disabling the check is recommended if
you're sure that type checking should terminate)
In the third argument of ‘subsume’, namely ‘method’
In the expression: subsume p p method
In an equation for ‘value’: value p = subsume p p method
......@@ -15,6 +15,7 @@ test('T15290', normal, compile, [''])
test('T15290a', normal, compile_fail, [''])
test('T15290b', normal, compile_fail, [''])
test('T15316', normal, compile_fail, [''])
test('T15316A', normal, compile_fail, [''])
test('T15334', normal, compile_fail, [''])
test('T15359', normal, compile, [''])
test('T15359a', normal, compile, [''])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment