Operator precedence in Scala

Operator precedence is fixed in the Scala Reference – 6.12.3 Infix Operations by the first character in the operator. Listed in increasing order of precedence:

(all letters)
|
^
&
= !
< >
:
+ -
* / %
(all other special characters)

And it’s not very probable that it will change. It will probably create more problems than it fixes. If you’re used the normal operator precedence changing it for one class will be quite confusing.

Leave a Comment