protocol P {} extension P { init(_with instance: Self) { self = instance } } class Animal : P { init() {} convenience init(with instance: Animal) { self.init(_with: instance) } } class Cat : Animal { override init() {} } class Dog : Animal { override init() {} } let cat: Cat = Cat(with: Dog()) // Dog with Cat type??? print(type(of: cat))
(edited)