In scala swing I can do something like the following:
val field = new TextField("", 4)
field.text = "Hello"
And the assignment is implemented thus:
def text_=(t: String): Unit = peer.setText(t)
But if I try my own implementation such as:
case class A(i: Int) {
def value_=(j: Int) = copy(i = j)
}
val a = A(3)
a.value = 3
This will not compile for me. What am I missing?