I guess it has to do with the operator precedence and the way code is parsed. To get a very precise answer one would have to look closely at Scala's spec.
In general, I would recommend to write a function for @a
and another for @b
to make things really clear when reading code. E.g.:
def ta =
if (true) "@a" #> "xxx"
else "@a" #> "yyy"
def tb = "@b" #> "zzz"
val t1 = ta & tb
Scala has a very lightweight syntax that encourages such definition unlike many other programming language. Your code tend to be much more readable when using it. Have a look at Odersky's talk on Scala with Style. He explains other interesting tricks too.