In addition to Michael's answer, the assignment cannot be overridden in Scala, although you can create, for example, an assignment type statement, for example := .
The "assignments" that can be redefined are as follows:
// method update a(x) = y // method x_=, assuming method x exists and is also visible ax = y // method +=, though it will be converted to x = x + y if method += doesn't exist a += y
source share