I’ve searched for a half-hour, and still cannot figure it out.
In SIP: Modularizing Language Features there are a number of features which will require explicit “enabling” in Scala 2.10 (import language.feature).
Amongst them there is postfixOps, to which I just cannot find a reference anywhere. What exactly does this feature allow?
It allows you to use operator syntax in postfix position. For example
rather than
In this harmless example it is not a problem, but it can lead to ambiguities. This will not compile:
And the error message is not very helpful:
It tries to call the
:::method on the result of theforeachcall, which is of typeUnit. This is likely not what the programmer intended. To get the correct result, you need to insert a semicolon after the first line.