diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2021-09-06 21:46:51 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-17 09:37:41 -0400 |
commit | 9300c736d58fdb8b3e2961f57aa9c4f117fb9c6f (patch) | |
tree | 998159aafe3bb9c89f8983ec2ad08994fcb5807e /utils | |
parent | 0d996d029590d1523f2db64b608456e2228a19dc (diff) | |
download | haskell-9300c736d58fdb8b3e2961f57aa9c4f117fb9c6f.tar.gz |
EPA: correctly capture comments between 'where' and binds
In the following
foo = x
where -- do stuff
doStuff = do stuff
The "-- do stuff" comment is captured in the HsValBinds.
Closes #20297
Diffstat (limited to 'utils')
-rw-r--r-- | utils/check-exact/Main.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/check-exact/Main.hs b/utils/check-exact/Main.hs index 2b93f2553e..73c99345f2 100644 --- a/utils/check-exact/Main.hs +++ b/utils/check-exact/Main.hs @@ -518,7 +518,7 @@ changeLocalDecls libdir (L l p) = do let binds' = (HsValBinds van' (ValBinds sortKey (listToBag $ decl':oldBinds) (sig':os':oldSigs))) - return (L lm (Match an mln pats (GRHSs noExtField rhs binds'))) + return (L lm (Match an mln pats (GRHSs emptyComments rhs binds'))) replaceLocalBinds x = return x return (L l p') @@ -548,7 +548,7 @@ changeLocalDecls2 libdir (L l p) = do let sortKey = captureOrder decls let binds = (HsValBinds an (ValBinds sortKey (listToBag $ [decl']) [sig'])) - return (L lm (Match ma mln pats (GRHSs noExtField rhs binds))) + return (L lm (Match ma mln pats (GRHSs emptyComments rhs binds))) replaceLocalBinds x = return x return (L l p') |