summaryrefslogtreecommitdiff
path: root/testsuite/tests/printer
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2022-03-07 22:23:29 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-03-28 19:23:28 -0400
commit8229885cb6a9f78ab09468f3797e3ec48ea24f82 (patch)
tree568e100868454269d5e6a382d3503bd40a9ba548 /testsuite/tests/printer
parent89cb13153dbe9a88706c43dbf0f681e90ecaa599 (diff)
downloadhaskell-8229885cb6a9f78ab09468f3797e3ec48ea24f82.tar.gz
EPA: let stmt with semicolon has wrong anchor
The code let ;x =1 Captures the semicolon annotation, but did not widen the anchor in the ValBinds. Fix that. Closes #20247
Diffstat (limited to 'testsuite/tests/printer')
-rw-r--r--testsuite/tests/printer/Makefile6
-rw-r--r--testsuite/tests/printer/Test20247.hs4
-rw-r--r--testsuite/tests/printer/all.T1
3 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/printer/Makefile b/testsuite/tests/printer/Makefile
index 749315c60a..2c4195eeb1 100644
--- a/testsuite/tests/printer/Makefile
+++ b/testsuite/tests/printer/Makefile
@@ -734,6 +734,12 @@ Test20243:
$(CHECK_PPR) $(LIBDIR) Test20243.hs
$(CHECK_EXACT) $(LIBDIR) Test20243.hs
+.PHONY: Test20247
+Test20247:
+ $(CHECK_PPR) $(LIBDIR) Test20247.hs
+ $(CHECK_EXACT) $(LIBDIR) Test20247.hs
+
+
.PHONY: Test20258
Test20258:
$(CHECK_PPR) $(LIBDIR) Test20258.hs
diff --git a/testsuite/tests/printer/Test20247.hs b/testsuite/tests/printer/Test20247.hs
new file mode 100644
index 0000000000..8c2521fe9a
--- /dev/null
+++ b/testsuite/tests/printer/Test20247.hs
@@ -0,0 +1,4 @@
+module Test20247 where
+
+foo = do
+ let ;x =1
diff --git a/testsuite/tests/printer/all.T b/testsuite/tests/printer/all.T
index 3d7c28e453..4562acc8e5 100644
--- a/testsuite/tests/printer/all.T
+++ b/testsuite/tests/printer/all.T
@@ -173,6 +173,7 @@ test('PprUnicodeSyntax', [ignore_stderr, req_ppr_deps], makefile_test, ['PprUnic
test('PprCommentPlacement2', [ignore_stderr, req_ppr_deps], makefile_test, ['PprCommentPlacement2'])
test('Test20243', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20243'])
+test('Test20247', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20247'])
test('Test20258', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20258'])
test('Test20297', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20297'])
test('Test20846', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20846'])