tweag / ormolu

A formatter for Haskell source code
https://ormolu-live.tweag.io
Other
958 stars 83 forks source link

Ormolu produces invalid syntax when using operators as record fields #383

Closed utdemir closed 5 years ago

utdemir commented 5 years ago

Original:

foo = Foo { (+) = 3 }
bar = foo { (+) = 4 }

After Ormolu (with --unsafe)

foo = Foo {+ = 3}

bar = foo {+ = 4}

Where the parentheses around + is removed causing a syntax error,

Found when formatting linear-base.

mrkkrp commented 5 years ago

TBH, I did not know this is even possible!