It is possible to return any type of a generic class? Below is an example. Can I use the function "manager" to return any type of the generic class "Manager"? I know that the "some" keyword is not working at the inner of the "<>" statements. But I think you will know what I want to achieve with this.
// Base-Class
class Animal {
}
class Dog: Animal {
}
// Generic Class
class Manager<T: Animal> {
}
class DogManager: Manager<Dog> {
}
// Function which should return any generic class
func manager(for animal: Animal) -> Manager<some Animal> {
return DogManager()
}