Why can't I write a function which returns an array of type Self, whereas I can do it for a single Self item?
I can write :
class func test(text: String) -> [Any] {
return [
Self.init(text: text),
Self.init(text: text),
Self.init(text: text)
]
}
But the compiler doesn't know the output types.
And [Self]
does not work..
I need that for subclass reasons..
Thanks!