Avatar
@swift-4.2.4 class Base { class var defaultX: Int { return 12 } func foo(x: Int = defaultX) {} } class Derived : Base { override class var defaultX: Int { return 42 } override func foo(x: Int = defaultX) { print(x) } } func test1(obj: Base) { obj.foo() } func test2(obj: Derived) { obj.foo() } test1(obj: Derived()) test2(obj: Derived())