Incorrect redundant backet suggestion with `BlockArguments` and operator sections
pnotequalnp opened this issue · 0 comments
pnotequalnp commented
When the operand of a left operator section is an application with the argument a lambda taking advantage of BlockArguments
, an incorrect suggestion to remove the brackets around the application is given. Removal of these brackets would move the operator inside the lambda, resulting in a syntax error.
Example module:
{-# LANGUAGE BlockArguments #-}
module Example where
f = ((const 1 \_ -> ()) +)
Emitted suggestion:
Example.hs:5:6-23: Suggestion: Redundant bracket
Found:
((const 1 \ _ -> ()) +)
Perhaps:
(const 1 \ _ -> () +)
Module after accepting the suggestion (syntax error):
{-# LANGUAGE BlockArguments #-}
module Example where
f = (const 1 \_ -> () +)