diff options
author | Kirill Elagin <kirelagin@gmail.com> | 2020-03-04 22:46:42 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-03-12 09:45:51 -0400 |
commit | 1f9db3e79bd0d70e5a1491174d540717f3bce2bf (patch) | |
tree | 96dfe80d14aeb2db96c667b1a806c94e21f9fb54 /testsuite/tests/ado/all.T | |
parent | cb93a1a4405b448e83cad973f93dab3f7f050736 (diff) | |
download | haskell-1f9db3e79bd0d70e5a1491174d540717f3bce2bf.tar.gz |
pretty-printer: Properly parenthesise LastStmt
After ApplicatveDo strips the last `return` during renaming, the pretty
printer has to restore it. However, if the return was followed by `$`,
the dollar was stripped too and not restored.
For example, the last stamement in:
```
foo = do
x <- ...
...
return $ f x
```
would be printed as:
```
return f x
```
This commit preserved the dolar, so it becomes:
```
return $ f x
```
Diffstat (limited to 'testsuite/tests/ado/all.T')
-rw-r--r-- | testsuite/tests/ado/all.T | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/testsuite/tests/ado/all.T b/testsuite/tests/ado/all.T index 634aae2314..11a9f4d6c8 100644 --- a/testsuite/tests/ado/all.T +++ b/testsuite/tests/ado/all.T @@ -6,6 +6,7 @@ test('ado005', normal, compile_fail, ['']) test('ado006', normal, compile, ['']) test('ado007', normal, compile, ['']) test('ado008', normal, compile, ['']) +test('ado009', normal, compile, ['']) test('T11607', normal, compile_and_run, ['']) test('ado-optimal', normal, compile_and_run, ['']) test('T12490', normal, compile, ['']) |