Commit 819b9cfd authored by Ryan Scott's avatar Ryan Scott

Add regression tests for #11515 and #12563

Happily, both of these issues appear to have been fixed in GHC 8.2.
Let's add regression tests for them to ensure that they stay fixed.
parent 5d3b15ec
{-# LANGUAGE ConstraintKinds, TypeFamilies #-}
module T11515 where
type family ShowSyn a where ShowSyn a = Show a
foo :: (ShowSyn a, _) => a -> String
foo x = show x
T11515.hs:7:20: error:
• Found type wildcard ‘_’ standing for ‘()’
To use the inferred type, enable PartialTypeSignatures
• In the type signature: foo :: (ShowSyn a, _) => a -> String
......@@ -59,6 +59,7 @@ test('T10615', normal, compile_fail, [''])
test('T10045', normal, compile_fail, [''])
test('T10999', normal, compile_fail, [''])
test('T11122', normal, compile, [''])
test('T11515', normal, compile_fail, [''])
test('T11976', normal, compile_fail, [''])
test('PatBind3', normal, compile_fail, [''])
test('T12039', normal, compile_fail, [''])
......
{-# LANGUAGE RankNTypes #-}
module T12563 where
foo :: ((forall a. f a) -> f r) -> f r
foo g = undefined
x = \g -> foo g
T12563.hs:7:15: error:
• Cannot instantiate unification variable ‘p0’
with a type involving foralls: (forall a. f0 a) -> f0 r0
GHC doesn't yet support impredicative polymorphism
• In the first argument of ‘foo’, namely ‘g’
In the expression: foo g
In the expression: \ g -> foo g
• Relevant bindings include
g :: p0 (bound at T12563.hs:7:6)
x :: p0 -> f0 r0 (bound at T12563.hs:7:1)
......@@ -415,6 +415,7 @@ test('T12170a', normal, compile_fail, [''])
test('T12124', normal, compile_fail, [''])
test('T12589', normal, compile_fail, [''])
test('T12529', normal, compile_fail, [''])
test('T12563', normal, compile_fail, [''])
test('T12648', normal, compile_fail, [''])
test('T12729', normal, compile_fail, [''])
test('T12785b', normal, compile_fail, [''])
......
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