> On May 16, 2016, at 7:09 AM, tuuranton--- via swift-users > <swift-users@swift.org> wrote: > > Why does the following code compile? > Why does Bar's init(x: Int) automatically call Foo's init()? > Why don't I have to manually call super.init() myself? > > What passage of > https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Initialization.html#//apple_ref/doc/uid/TP40014097-CH18-ID203 > tells me that this should be the case?
Looks like a bug. Do you mind filing a bug report on bugs.swift.org? -Joe > -------------------- > class Foo { > init() { > print("foo init") > } > } > class Bar: Foo { > init(x: Int) { > print("bar init") > } > } > let b = Bar(x: 0) > //prints: > // bar init > // foo init > _______________________________________________ > swift-users mailing list > swift-users@swift.org > https://lists.swift.org/mailman/listinfo/swift-users _______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users