Следующий класс имеет вспомогательный конструктор для неизменного изменения одного свойства.Отсутствующие члены из аргументов конструктора по умолчанию
class AccUnit(size: Long, start: Date, direction:Direction, protocol:String) {
def this(size:Long, that:AccUnit) {this(size, that.start, that.direction, that.protocol)}
}
Компилятор возвращает ошибку:
AccUnit.scala:26: error: value start is not a member of trafacct.AccUnit
def this(size:Long, that:AccUnit) {this(size, that.start, that.direction, that.protocol)}
^
AccUnit.scala:26: error: value direction is not a member of trafacct.AccUnit
def this(size:Long, that:AccUnit) {this(size, that.start, that.direction, that.protocol)}
^
AccUnit.scala:26: error: value protocol is not a member of trafacct.AccUnit
def this(size:Long, that:AccUnit) {this(size, that.start, that.direction, that.protocol)}
Почему думает, что нет таких членов?
Связанные http://stackoverflow.com/q/2400794/203968 – oluies
Связанные http://stackoverflow.com/q/3900307/203968 – oluies