<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><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(146, 146, 146);" class=""><div style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px;" class="">Of course, I would love being able to use an initializer setup, but there are serious bugs in the implementation.</div><div style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px;" class=""><pre style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 0.94em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); white-space: pre-wrap; word-wrap: break-word; padding: 5px;" class=""><div style="white-space: normal; font-family: Helvetica; font-size: 12px;" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 1);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> Clonable</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">{</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(other: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(73, 134, 114);" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 1);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(95, 174, 174);" class="">Clonable</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">{</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> clone() -> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(73, 134, 114);" class="">Self</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">                </span>{ </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">return</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> type(of: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">).</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(<wbr class="">other: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(95, 174, 174);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> Base: </span><span style="font-variant-ligatures: no-common-ligatures;" class="">Clonable</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">{</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> x: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(91, 38, 153);" class="">Int</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><br class="m_-602078394375739685webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(x: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(91, 38, 153);" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">                </span>{ </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> = x }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><br class="m_-602078394375739685webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 1);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><span style="font-variant-ligatures: no-common-ligatures;" class="">required</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(other: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(95, 174, 174);" class="">Base</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">                </span>{ </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> = other.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> Derived: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(95, 174, 174);" class="">Base</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">{</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(91, 38, 153);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> y: </span><span style="font-variant-ligatures: no-common-ligatures;" class="">String</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><br class="m_-602078394375739685webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(x: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(91, 38, 153);" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures;" class="">, y: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(91, 38, 153);" class="">String</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span>{</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">                </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">y</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> = y</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">                </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">super</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(x: x)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span>}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><br class="m_-602078394375739685webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><span style="font-variant-ligatures: no-common-ligatures;" class="">// Should be required by the Clonable protocol, but it isn't.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 1);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><span style="font-variant-ligatures: no-common-ligatures;" class="">required</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(other: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(95, 174, 174);" class="">Derived</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span>{</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">                </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">y</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> = other.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">y</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">                </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">super</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(other: other)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span>}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><br class="m_-602078394375739685webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><span style="font-variant-ligatures: no-common-ligatures;" class="">// Required because it was `required` in Base. Even a `Derived` calls this initializer to clone, which is wrong. Bugs abound.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 1);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">        </span></span><span style="font-variant-ligatures: no-common-ligatures;" class="">required</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(other: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(95, 174, 174);" class="">Base</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(2, 37, 188);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="m_-602078394375739685Apple-tab-span" style="white-space: pre-wrap;">                </span>{ </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">fatalError</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"init(other:) is wrong."</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">let</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> me = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(95, 174, 174);" class="">Derived</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(x: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(218, 32, 0);" class="">1</span><span style="font-variant-ligatures: no-common-ligatures;" class="">, y: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(2, 37, 188);" class="">"food"</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 143, 1);" class="">let</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> alienClone = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">me</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">clone</span><span style="font-variant-ligatures: no-common-ligatures;" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// "init(other:) is wrong."</span></div><div class=""><br class=""></div></div></pre></div></span></div></div></blockquote><div class=""><br class=""></div><div class="">Agree. That seems wrong. Great example.</div></div></div></div></div></blockquote><br class=""></div><div>So, is this odd behavior intentional, a bug, or a design deficiency? I would think that when a protocol has a method or initializer has `Self` parameters—like in Clonable—every subclass would be required to implement its own specialized version (much like a required initializer). That would be a special case of the protocol system, though.</div><div><br class=""></div><div>As it sits, even fixing the calling behavior of my example leaves us with the problem of subclasses inheriting inapplicable required initializers from superclasses that actually don’t make any sense.</div><div><br class=""></div><div>Does this deserve its own thread?</div><br class=""></body></html>