Move 'HsBangTy' out in constructor arguments
authorAlec Theriault <alec.theriault@gmail.com>
Thu, 7 Jun 2018 17:26:53 +0000 (13:26 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 7 Jun 2018 22:06:29 +0000 (18:06 -0400)
commit0361fc038e117befc3c59fcd589d640006407ed6
treec7d38167a43fb4b099f4beeeb58056b8ca9db311
parentefea32cf2c41d35f2ba5a79bf70cc7768b7b0fd5
Move 'HsBangTy' out in constructor arguments

When run with -haddock, a constructor argument can have both a a
strictness/unpackedness annotation and a docstring. The parser binds
'HsBangTy' more tightly than 'HsDocTy', yet for constructor arguments we
really need the 'HsBangTy' on the outside.

This commit does this shuffling in the 'mkConDeclH98' and 'mkGadtDecl'
smart constructors.

Test Plan: haddockA038, haddockC038

Reviewers: bgamari, dfeuer

Reviewed By: bgamari

Subscribers: dfeuer, rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4727
compiler/parser/RdrHsSyn.hs
testsuite/tests/haddock/should_compile_flag_haddock/all.T
testsuite/tests/haddock/should_compile_flag_haddock/haddockA038.hs [new file with mode: 0644]
testsuite/tests/haddock/should_compile_flag_haddock/haddockA038.stderr [new file with mode: 0644]
testsuite/tests/haddock/should_compile_noflag_haddock/all.T
testsuite/tests/haddock/should_compile_noflag_haddock/haddockC038.hs [new file with mode: 0644]