[swift-users] Initializers

tuuranton at tutanota.de tuuranton at tutanota.de
Fri Jan 27 10:45:55 CST 2017


See the comments. Why is one allowed but the other one isn't and what's the rationale for this?

class Vehicle {    let name: String    init(name: String) {        self.name = name    }}

class Car: Vehicle {    //Why is this not allowed?    override init?(name: String) {        super.init(name: name)    }        //But this is allowed?    init?(name: String, ignore: String) {        super.init(name: name)    }}


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170127/aeef2f76/attachment.html>


More information about the swift-users mailing list