diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-11-14 15:26:19 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2017-11-27 16:57:19 +0000 |
commit | 4efe5fed407067d4b27000e0cf4092cfb6f7502b (patch) | |
tree | 73b9e91b589ff78dc2206391267ed7e6901daf7e /testsuite/tests/partial-sigs | |
parent | 00b96b27d9a014a5d788960eea7edb811a48570e (diff) | |
download | haskell-4efe5fed407067d4b27000e0cf4092cfb6f7502b.tar.gz |
Check quantification for partial type signatues
Trac #14449 showed that we were failing to check that the
quantified type variables of a partial type signature remained
distinct.
See Note [Quantified variables in partial type signatures]
in TcBinds.
A little refactoring along the way.
Diffstat (limited to 'testsuite/tests/partial-sigs')
-rw-r--r-- | testsuite/tests/partial-sigs/should_fail/T14449.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/partial-sigs/should_fail/T14449.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/partial-sigs/should_fail/all.T | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/partial-sigs/should_fail/T14449.hs b/testsuite/tests/partial-sigs/should_fail/T14449.hs new file mode 100644 index 0000000000..d49a390af2 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_fail/T14449.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE PartialTypeSignatures #-} + +module T14449 where + +f :: a -> b -> _ +f x y = [x, y] diff --git a/testsuite/tests/partial-sigs/should_fail/T14449.stderr b/testsuite/tests/partial-sigs/should_fail/T14449.stderr new file mode 100644 index 0000000000..01e73b5edb --- /dev/null +++ b/testsuite/tests/partial-sigs/should_fail/T14449.stderr @@ -0,0 +1,4 @@ + +T14449.hs:6:1: error: + Couldn't match ‘a’ with ‘b’ + both bound by the partial type signature: f :: a -> b -> _ diff --git a/testsuite/tests/partial-sigs/should_fail/all.T b/testsuite/tests/partial-sigs/should_fail/all.T index 183791868f..d452dad101 100644 --- a/testsuite/tests/partial-sigs/should_fail/all.T +++ b/testsuite/tests/partial-sigs/should_fail/all.T @@ -64,3 +64,4 @@ test('PatBind3', normal, compile_fail, ['']) test('T12039', normal, compile_fail, ['']) test('T12634', normal, compile_fail, ['']) test('T12732', normal, compile_fail, ['-fobject-code -fdefer-typed-holes']) +test('T14449', normal, compile_fail, ['']) |