Make {hsExpr,hsType,pat}NeedsParens aware of boxed 1-tuples
`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.
Showing
- compiler/GHC/Hs/Expr.hs 5 additions, 0 deletionscompiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Pat.hs 6 additions, 1 deletioncompiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Type.hs 14 additions, 0 deletionscompiler/GHC/Hs/Type.hs
- testsuite/tests/th/T18612.hs 14 additions, 0 deletionstestsuite/tests/th/T18612.hs
- testsuite/tests/th/T18612.stderr 13 additions, 0 deletionstestsuite/tests/th/T18612.stderr
- testsuite/tests/th/all.T 1 addition, 0 deletionstestsuite/tests/th/all.T
Loading
Please register or sign in to comment