i am learning scala ( like it! ) but there is something i dont understand. i read about right associative operand by method names ending with ":". Easy to understand but i wanted to define my own right associative function named add3To:.
I have a syntaxerror and dont know why:
case class MyInt(x : Int) {
def add3 = x+3
def add3To:= x+3 // dont understand whats wrong here
}
val myInt = MyInt(4)
println(myInt add3) // working
println(add3To myInt) // not working
Maybe ( i am pretty sure) i did a dumb mistake! But i dont see it.