I saw some discussions about this issue, but did not get a satisfactory explanation. Can someone tell me why this is not working?
class Parent<T> {
var data:T
init(data:T) {
self.data = data
}
}
class Child : Parent<Int> {}
let c = Child(data: 4)
The last line gives an error:
'Child' cannot be constructed because it has no accessible initializers
Do I really need to implement a call-only initializer super?
Edit:
, . Action, generics, , , Swift, , . (, CustomAction). init . , , , .
class Action<Input, Output> {
var cachedOutput:Output?
init(cachedOutput:Output?) {
self.cachedOutput = cachedOutput
}
}
protocol CustomInput {}
protocol CustomOutput {}
class CustomAction : Action<CustomInput, CustomOutput> {
}