I encountered this syntax in someone else's Scala code, and don't remember reading about it:
val c = new C { i = 5 }
It appears that the block after the new C is equivalent to:
val c = new C
c.i = 5
assuming a class definition like:
class C {
var ii = 1
def i_=(v: Int) { ii = v }
def i = ii
}
What is this syntax called in Scala? I want to read more about it, but I can't find it described in Programming in Scala or elsewhere.