class Animal { init(x: Int) { } static func bb() -> Self { return .init(x: 3) } } class Cat : Animal { var name: String = "cat dayo" } func useCat(cat: Cat) { print(cat.name) } func main() { useCat(cat: Cat.bb()) } main()
class Dog : Animal { var name: String = "I am pochi" init(x: Int) { super.init() } func bowow() { print(name) } }
(edited)