Skip to content

Make renamer to be more flexible with parens in the LHS of the rules

Zejun Wu requested to merge watashi/ghc:rule_lhs_par into master

We used to reject LHS like (f a) b in RULES and requires it to be written as f a b. It will be handy to allow both as the expression may be more readable with extra parens in some cases when infix operator is involved. Espceially when TemplateHaskell is used, extra parens may be added out of user's control and result in "valid" rules being rejected and there are not always ways to workaround it.

Fixes #24621

See the new test case added, which used to be rejected by ghc and now works fine.

Edited by Zejun Wu

Merge request reports