diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-07-27 16:52:52 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-08-04 01:33:03 -0400 |
commit | 2c714f07f4ab6823de50aaa4947e86326799f44f (patch) | |
tree | b2fcf0005c23adc062b1ddd9e814aa743450cec9 /testsuite/tests/linear | |
parent | 4f6726779fa3cbbfe97de49b1d26d5a665c74840 (diff) | |
download | haskell-2c714f07f4ab6823de50aaa4947e86326799f44f.tar.gz |
Disable -fdefer-type-errors for linear types (#20083)
Diffstat (limited to 'testsuite/tests/linear')
-rw-r--r-- | testsuite/tests/linear/should_fail/LinearPolyType.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/linear/should_fail/T20083.hs | 9 | ||||
-rw-r--r-- | testsuite/tests/linear/should_fail/T20083.stderr | 18 | ||||
-rw-r--r-- | testsuite/tests/linear/should_fail/all.T | 1 |
4 files changed, 30 insertions, 2 deletions
diff --git a/testsuite/tests/linear/should_fail/LinearPolyType.stderr b/testsuite/tests/linear/should_fail/LinearPolyType.stderr index c2d8b7d452..22d8013aed 100644 --- a/testsuite/tests/linear/should_fail/LinearPolyType.stderr +++ b/testsuite/tests/linear/should_fail/LinearPolyType.stderr @@ -1,6 +1,6 @@ LinearPolyType.hs:15:1: error: - Multiplicity coercions are currently not supported (see GHC #19517) + GHC bug #19517: GHC currently does not support programs using GADTs or type families to witness equality of multiplicities LinearPolyType.hs:15:1: error: - Multiplicity coercions are currently not supported (see GHC #19517) + GHC bug #19517: GHC currently does not support programs using GADTs or type families to witness equality of multiplicities diff --git a/testsuite/tests/linear/should_fail/T20083.hs b/testsuite/tests/linear/should_fail/T20083.hs new file mode 100644 index 0000000000..21a0ca98b4 --- /dev/null +++ b/testsuite/tests/linear/should_fail/T20083.hs @@ -0,0 +1,9 @@ +{-# OPTIONS_GHC -fdefer-type-errors #-} + +module T20083 where + +ap :: (a -> b) -> a %m -> b +ap f x = f x + +ap2 :: a %1-> () +ap2 _ = () diff --git a/testsuite/tests/linear/should_fail/T20083.stderr b/testsuite/tests/linear/should_fail/T20083.stderr new file mode 100644 index 0000000000..5799d7c86d --- /dev/null +++ b/testsuite/tests/linear/should_fail/T20083.stderr @@ -0,0 +1,18 @@ + +T20083.hs:6:6: error: + • Couldn't match type ‘m’ with ‘'Many’ + arising from multiplicity of ‘x’ + ‘m’ is a rigid type variable bound by + the type signature for: + ap :: forall a b (m :: GHC.Types.Multiplicity). + (a -> b) -> a %m -> b + at T20083.hs:5:1-27 + • In an equation for ‘ap’: ap f x = f x + • Relevant bindings include + ap :: (a -> b) -> a %m -> b (bound at T20083.hs:6:1) + +T20083.hs:9:5: error: + • Couldn't match type ‘'Many’ with ‘'One’ + arising from a non-linear pattern + • In the pattern: _ + In an equation for ‘ap2’: ap2 _ = () diff --git a/testsuite/tests/linear/should_fail/all.T b/testsuite/tests/linear/should_fail/all.T index bf0f392192..89363cba85 100644 --- a/testsuite/tests/linear/should_fail/all.T +++ b/testsuite/tests/linear/should_fail/all.T @@ -38,3 +38,4 @@ test('LinearTHFail3', normal, compile_fail, ['']) test('T18888', normal, compile_fail, ['']) test('T18888_datakinds', normal, compile_fail, ['']) test('T19120', normal, compile_fail, ['']) +test('T20083', normal, compile_fail, ['-XLinearTypes']) |