// ...
}
fun ClassA(a: ClassA): ClassA_array {
// promote to ClassA_array
// ...
}
class ClassA() {
// ...
}
class ClassA_array() {
// ...
}
You don't need to promote anything anyhow, that's just a function where you create new instance of ClassB and return it. You can even make it's original constructor invisible from outside, so that only your factory can be used to create one: class ClassA_array internal constructor () {
Обсуждают сегодня