diff options
author | jackohughes <jack@jackohughes.com> | 2022-04-11 19:41:02 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-05-13 12:10:34 -0400 |
commit | 668a9ef496f9df7e628397c4de9a0a4fcdcd7e6a (patch) | |
tree | 11a79dacda0b6c7cf550dc5c6d34af82fa965620 /testsuite | |
parent | 3bf938b6c5e1190f3a55e149deaec2f6309d398f (diff) | |
download | haskell-668a9ef496f9df7e628397c4de9a0a4fcdcd7e6a.tar.gz |
Fix printing of brackets in multiplicities (#20315)
Change mulArrow to allow for printing of correct application precedence
where necessary and update callers of mulArrow to reflect this.
As part of this, move mulArrow from GHC/Utils/Outputtable to GHC/Iface/Type.
Fixes #20315
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/printer/Test20315.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/printer/Test20315.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/printer/all.T | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/printer/Test20315.hs b/testsuite/tests/printer/Test20315.hs new file mode 100644 index 0000000000..bff072596d --- /dev/null +++ b/testsuite/tests/printer/Test20315.hs @@ -0,0 +1,3 @@ +{-# LANGUAGE LinearTypes #-} + +f = id :: a %(m n) -> a diff --git a/testsuite/tests/printer/Test20315.stderr b/testsuite/tests/printer/Test20315.stderr new file mode 100644 index 0000000000..061459f23b --- /dev/null +++ b/testsuite/tests/printer/Test20315.stderr @@ -0,0 +1,7 @@ + +Test20315.hs:3:5: error: + • Couldn't match type ‘'Many’ with ‘m1 n1’ + Expected: a1 %(m1 n1) -> a1 + Actual: a1 -> a1 + • In the expression: id :: a %(m n) -> a + In an equation for ‘f’: f = id :: a %(m n) -> a diff --git a/testsuite/tests/printer/all.T b/testsuite/tests/printer/all.T index 12b3960a7a..7852a8adbe 100644 --- a/testsuite/tests/printer/all.T +++ b/testsuite/tests/printer/all.T @@ -177,4 +177,5 @@ test('Test20247', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20247']) test('Test20256', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20256']) test('Test20258', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20258']) test('Test20297', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20297']) +test('Test20315', normal, compile_fail, ['']) test('Test20846', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20846']) |