Skip to content
Snippets Groups Projects
Commit ad16a066 authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski Committed by Marge Bot
Browse files

Add a test for #21278

parent 87eebf98
No related branches found
No related tags found
No related merge requests found
{-# LANGUAGE LinearTypes #-}
module T21278 where
data C a = forall p. C (a %p -> a)
f :: C a -> C a
f b = C (\x -> case b of C g -> g x)
T21278.hs:7:11: error: [GHC-25897]
• Couldn't match type ‘p’ with ‘Many’
arising from multiplicity of ‘x’
‘p’ is a rigid type variable bound by
a pattern with constructor:
C :: forall a (p :: GHC.Types.Multiplicity). (a %p -> a) %1 -> C a,
in a case alternative
at T21278.hs:7:26-28
• In the first argument of ‘C’, namely
‘(\ x -> case b of C g -> g x)’
In the expression: C (\ x -> case b of C g -> g x)
In an equation for ‘f’: f b = C (\ x -> case b of C g -> g x)
......@@ -40,3 +40,4 @@ test('T18888_datakinds', normal, compile_fail, [''])
test('T19120', normal, compile_fail, [''])
test('T20083', normal, compile_fail, ['-XLinearTypes'])
test('T19361', normal, compile_fail, [''])
test('T21278', normal, compile_fail, ['-XLinearTypes'])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment