diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-05-18 11:50:07 -0400 |
---|---|---|
committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-05-18 11:50:18 -0400 |
commit | 819b9cfd21a1773091cec4e34716a0fd7c7d05c6 (patch) | |
tree | 7d40e303be618f2b9f454ef736263e450ad9c05c /testsuite | |
parent | 5d3b15ecbf17b7747c2f7313a981c60a2d22904d (diff) | |
download | haskell-819b9cfd21a1773091cec4e34716a0fd7c7d05c6.tar.gz |
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.
Diffstat (limited to 'testsuite')
6 files changed, 33 insertions, 0 deletions
diff --git a/testsuite/tests/partial-sigs/should_fail/T11515.hs b/testsuite/tests/partial-sigs/should_fail/T11515.hs new file mode 100644 index 0000000000..2a03e240a8 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_fail/T11515.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE ConstraintKinds, TypeFamilies #-} + +module T11515 where + +type family ShowSyn a where ShowSyn a = Show a + +foo :: (ShowSyn a, _) => a -> String +foo x = show x diff --git a/testsuite/tests/partial-sigs/should_fail/T11515.stderr b/testsuite/tests/partial-sigs/should_fail/T11515.stderr new file mode 100644 index 0000000000..2870457500 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_fail/T11515.stderr @@ -0,0 +1,5 @@ + +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 diff --git a/testsuite/tests/partial-sigs/should_fail/all.T b/testsuite/tests/partial-sigs/should_fail/all.T index 2439f64e14..9866029e91 100644 --- a/testsuite/tests/partial-sigs/should_fail/all.T +++ b/testsuite/tests/partial-sigs/should_fail/all.T @@ -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, ['']) diff --git a/testsuite/tests/typecheck/should_fail/T12563.hs b/testsuite/tests/typecheck/should_fail/T12563.hs new file mode 100644 index 0000000000..394fa615d8 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T12563.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE RankNTypes #-} +module T12563 where + +foo :: ((forall a. f a) -> f r) -> f r +foo g = undefined + +x = \g -> foo g diff --git a/testsuite/tests/typecheck/should_fail/T12563.stderr b/testsuite/tests/typecheck/should_fail/T12563.stderr new file mode 100644 index 0000000000..f32e99d1f0 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T12563.stderr @@ -0,0 +1,11 @@ + +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) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index e4aa682404..5a3e73313f 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -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, ['']) |