Scala's handling of superclass constructor parameters is confusing me...
with this code:
class ArrayElement(val contents: Array[String]) {
...
}
class LineElement(s: String) extends ArrayElement(Array(s)) {
...
}
LineElement is declared to extend ArrayElement, it seems strange to me that the Array(s)
parameter in ArrayElement(Array(s))
is creating an Array instance - runtime??? Is this scala's syntatic sugar or is there something else going on here?