Avatar
@swiftbot class Base { func foo(x: Int = 12) {} } class Derived : Base { override func foo(x: Int = 42) { print(x) } } func test1(obj: Base) { obj.foo() } func test2(obj: Derived) { obj.foo() } test1(obj: Derived()) test2(obj: Derived()) (edited)
🛠 1