<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Convenience initializers are inherited when you override all of your parent class's designated initializers. If you change the signature of the designated initializer, then the convenience initializers will no longer do the right thing.</div><div class=""><br class=""></div><div class="">However, we could allow this case and just consider it shadowing the original initializer rather than overriding. In that case, though, we'd probably want something like @nonoverriding to make it clear that it was intentional.</div><div class=""><br class=""></div><div class="">Jordan</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 27, 2017, at 10:39, tuuranton--- via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">
  
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" class="">
  
  <div class="">
Yes, but why?<div class=""><br class=""><div class="">What's the rationale for this?</div><div class=""><br class=""></div><div class="">What would be so bad about allowing overriding a non-failable initializer with a failable initializer?</div><div class=""><br class="">27. Jan 2017 18:59 by <a href="mailto:saagar@saagarjha.com" target="_blank" rel="noopener noreferrer" class="">saagar@saagarjha.com</a>:<br class=""><br class=""><blockquote class="tutanota_quote" style="border-left: 1px solid #93A3B8; padding-left: 10px; margin-left: 5px;">You can’t override a designated initializer with one that is failable. The second one is defining a new initializer that is failable, instead of overriding the one from its superclass.<div class=""><br class=""><div class="">
<div style="letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class="">Saagar Jha</div>

</div>
<br class=""><div class=""><blockquote class="thunderbird_quote" style="border-left: 1px solid #93a3b8 ; padding-left: 10px ; margin-left: 5px"><div class="">On Jan 27, 2017, at 8:45 AM, tuuranton--- via swift-users &lt;<a href="mailto:swift-users@swift.org" target="_blank" rel="noopener noreferrer" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">
  
    
  
  <div class="">
<div class="">See the comments. Why is one allowed but the other one isn't and what's the rationale for this?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">class Vehicle {</div><div class="">&nbsp; &nbsp; let name: String</div><div class="">&nbsp; &nbsp; init(name: String) {</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; self.name = name</div><div class="">&nbsp; &nbsp; }</div><div class="">}</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">class Car: Vehicle {</div><div class="">&nbsp; &nbsp; //Why is this not allowed?</div><div class="">&nbsp; &nbsp; override init?(name: String) {</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; super.init(name: name)</div><div class="">&nbsp; &nbsp; }</div><div class="">&nbsp; &nbsp;&nbsp;</div><div class="">&nbsp; &nbsp; //But this is allowed?</div><div class="">&nbsp; &nbsp; init?(name: String, ignore: String) {</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; super.init(name: name)</div><div class="">&nbsp; &nbsp; }</div><div class="">}</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div>  </div>

_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" target="_blank" rel="noopener noreferrer" class="">swift-users@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank" rel="noopener noreferrer" class="">https://lists.swift.org/mailman/listinfo/swift-users</a><br class=""></div></blockquote></div><br class=""></div></blockquote></div></div>  </div>

_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></body></html>