Ticket #207 (new bug report)
Fixity resolution incorrectly handles shadowed operators
|Reported by:||benmachine||Owned by:||nibro|
When an operator name is shadowed, haskell-src-exts continues to use the fixity from the outer scope. This is obviously wrong when the operator carries its own fixity declaration (I think this is merely a problem of adding the new fixities to the front of the list rather than the back) but in fact shadowing an operator without a fixity declaration should reset it to infixl 9 - so we have the somewhat trickier problem of detecting when any new operator names are introduced that might shadow an outer definition. In the extreme case with TH or a quasiquoter this is actually impossible, I think, but it would still be nice to respect the (admittedly quite rare) case of an operator name defined inline.
An example of where this would go wrong is the following definition that lambdabot gives for on:
(*) `on` f = \x y -> f x * f y
In the RHS here, HSE would give * fixity 7, when it should really have fixity 9. In this case it wouldn't make a difference, but it's not hard to construct cases where it would.