diff options
-rw-r--r-- | testsuite/tests/polykinds/T9222.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T9222.stderr | 24 | ||||
-rw-r--r-- | testsuite/tests/polykinds/all.T | 2 |
3 files changed, 31 insertions, 1 deletions
diff --git a/testsuite/tests/polykinds/T9222.hs b/testsuite/tests/polykinds/T9222.hs index df112519ac..8e46ccb3c5 100644 --- a/testsuite/tests/polykinds/T9222.hs +++ b/testsuite/tests/polykinds/T9222.hs @@ -3,5 +3,11 @@ module T9222 where import Data.Proxy +-- Nov 2014: actually the type of Want is ambiguous if we +-- do the full co/contra thing for subtyping, +-- which we now do +-- So this program is erroneous. (But the original ticket was +-- a crash, and that's still fixed!) + data Want :: (i,j) -> * where Want :: (a ~ '(b,c) => Proxy b) -> Want a diff --git a/testsuite/tests/polykinds/T9222.stderr b/testsuite/tests/polykinds/T9222.stderr new file mode 100644 index 0000000000..8e838e7bd5 --- /dev/null +++ b/testsuite/tests/polykinds/T9222.stderr @@ -0,0 +1,24 @@ + +T9222.hs:13:3: + Couldn't match type ‘b0’ with ‘b’ + ‘b0’ is untouchable + inside the constraints (a ~ '(b0, c0)) + bound by the type of the constructor ‘Want’: + (a ~ '(b0, c0)) => Proxy b0 + at T9222.hs:13:3 + ‘b’ is a rigid type variable bound by + the type of the constructor ‘Want’: + ((a ~ '(b, c)) => Proxy b) -> Want a + at T9222.hs:13:3 + Expected type: '(b, c) + Actual type: a + In the ambiguity check for the type of the constructor ‘Want’: + Want :: forall (k :: BOX) + (k1 :: BOX) + (a :: (,) k k1) + (b :: k) + (c :: k1). + ((a ~ '(b, c)) => Proxy b) -> Want a + To defer the ambiguity check to use sites, enable AllowAmbiguousTypes + In the definition of data constructor ‘Want’ + In the data declaration for ‘Want’ diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 48b0e61b5e..74718ab98d 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -102,7 +102,7 @@ test('T8705', normal, compile, ['']) test('T8985', normal, compile, ['']) test('T9106', normal, compile_fail, ['']) test('T9144', normal, compile_fail, ['']) -test('T9222', normal, compile, ['']) +test('T9222', normal, compile_fail, ['']) test('T9264', normal, compile, ['']) test('T9263', normal, run_command, ['$MAKE -s --no-print-directory T9263']) test('T9063', normal, compile, ['']) |