<div dir="ltr"><div><div><span style="font-family:monospace,monospace">final class First {</span><br></div><div><div><font face="monospace, monospace"> let item: First</font></div><div><font face="monospace, monospace"> init(item: First) {</font></div><div><font face="monospace, monospace"> self.item = item</font></div><div><font face="monospace, monospace"> }</font></div><div><font face="monospace, monospace">}</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">extension First {</font></div><div><font face="monospace, monospace"> convenience init() {</font></div><div><font face="monospace, monospace"> self.init(item: self)</font></div><div><font face="monospace, monospace"> }</font></div><div><font face="monospace, monospace">}</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">let a = First()</font></div></div><div><br></div><div>I'm actually a bit surprised that this compiles.</div></div><div>This should be diagnosed as: <font face="monospace, monospace">"error: 'self' used before self.init call" </font>I think.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-13 23:42 GMT+09:00 Dimitri Racordon <span dir="ltr"><<a href="mailto:Dimitri.Racordon@unige.ch" target="_blank">Dimitri.Racordon@unige.ch</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
But then!
<div><br>
</div>
<div>The following still shouldn’t compile:</div>
<div><br>
</div>
<div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(186,45,162)">
<span style="font-variant-ligatures:no-common-ligatures">final</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000">
</span><span style="font-variant-ligatures:no-common-ligatures">class</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000"> First {</span></div><span class="">
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">let</span><span style="font-variant-ligatures:no-common-ligatures"> item:
</span><span style="font-variant-ligatures:no-common-ligatures;color:#4f8187">First</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">init</span><span style="font-variant-ligatures:no-common-ligatures">(item:
</span><span style="font-variant-ligatures:no-common-ligatures;color:#4f8187">First</span><span style="font-variant-ligatures:no-common-ligatures">) {</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"> </span>
<span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">self</span><span style="font-variant-ligatures:no-common-ligatures">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#4f8187">item</span><span style="font-variant-ligatures:no-common-ligatures">
= item</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"> }</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">}</span></div>
</span></div>
<div><span style="font-variant-ligatures:no-common-ligatures"><br>
</span></div>
<div><br>
</div>
<div><br>
</div>
</div>
</blockquote></div><br></div>