Skip to content

Make {hsExpr,hsType,pat}NeedsParens aware of boxed 1-tuples

Ryan Scott requested to merge wip/T18612 into master

hsExprNeedsParens, hsTypeNeedsParens, and patNeedsParens previously assumed that all uses of explicit tuples in the source syntax never need to be parenthesized. This is true save for one exception: boxed one-tuples, which use the Solo data type from GHC.Tuple instead of special tuple syntax. This patch adds the necessary logic to the three *NeedsParens functions to handle Solo correctly.

Fixes #18612 (closed).

Merge request reports