From 4efe5fed407067d4b27000e0cf4092cfb6f7502b Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Tue, 14 Nov 2017 15:26:19 +0000 Subject: 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. --- testsuite/tests/partial-sigs/should_fail/T14449.hs | 6 ++++++ testsuite/tests/partial-sigs/should_fail/T14449.stderr | 4 ++++ testsuite/tests/partial-sigs/should_fail/all.T | 1 + 3 files changed, 11 insertions(+) create mode 100644 testsuite/tests/partial-sigs/should_fail/T14449.hs create mode 100644 testsuite/tests/partial-sigs/should_fail/T14449.stderr (limited to 'testsuite/tests/partial-sigs') 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, ['']) -- cgit v1.2.1