Nat Pryce pointed out these gems:

Scala Reference 6.12.3

“The precedence of an infix operator is determined by the operator’s first character.”

“The associativity of an operator is determined by the operator’s last character”

This actually made me cry.

1 thought on “Wat? Scala (Infix Operator Precedence and Associativity)

  1. Most languages have got a feature or two which, when you’re explaining them to a newbie, make you want to cringe and say “yeah, I know this sucks but…”. With Scala, these two are near the top of my list.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.