Avatar
norio_nomura 8/29/2017 1:30 AM
このような「バグでコンパイルできてしまう」パターンは、 既存の NSNumber 実装が踏み抜いている。 https://github.com/apple/swift-corelibs-foundation/blob/87466c45462cba5a085d5cd41d785d681016542d/Foundation/NSNumber.swift#L266 僕のcommitですね 🙂 これを元にphauslerさんがFactoryパターンで大幅に書き換えてるPR https://github.com/apple/swift-corelibs-foundation/pull/1095 がしばらく前から止まってるけど、非公開なブランチがApple内部で進んでるのかな?
1:31 AM
これに期待 https://github.com/apple/swift/pull/11637#discussion_r135388024 I have a whole branch that refractors almost ALL of the classes that follow the self replacement pattern. (edited)
Consider a class initializer that delegates to a protocol extension initializer, for example protocol P {} extension P { init() { ... } } class C : P { convenience init(foo: Int) { self.init()...