<div dir="ltr"><div class="gmail_default"><font face="monospace, monospace">Hi all,</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">Given the following example:</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><p style="margin:0px;font-size:12px;line-height:normal"><font face="monospace, monospace" color="#000000">struct Vector {</font></p>
<p style="margin:0px;font-size:12px;line-height:normal"><font face="monospace, monospace" color="#000000"><span class="" style="white-space:pre">        </span>var x: Double</font></p>
<p style="margin:0px;font-size:12px;line-height:normal"><font face="monospace, monospace" color="#000000"><span class="" style="white-space:pre">        </span>var y: Double</font></p>
<p style="margin:0px;font-size:12px;line-height:normal;min-height:17px"><span class="" style="white-space:pre"><font face="monospace, monospace" color="#000000">        </font></span></p>
<p style="margin:0px;font-size:12px;line-height:normal"><font face="monospace, monospace" color="#000000"><span class="" style="white-space:pre">        </span>init() {</font></p>
<p style="margin:0px;font-size:12px;line-height:normal"><font face="monospace, monospace" color="#000000"><span class="" style="white-space:pre">                </span><b>self.init(x: 0, y: 0)</b></font></p>
<p style="margin:0px;font-size:12px;line-height:normal"><font face="monospace, monospace" color="#000000"><span class="" style="white-space:pre">        </span>}</font></p>
<p style="margin:0px;font-size:12px;line-height:normal;min-height:17px"><span class="" style="white-space:pre"><font face="monospace, monospace" color="#000000">        </font></span></p>
<p style="margin:0px;font-size:12px;line-height:normal"><font face="monospace, monospace" color="#000000"><span class="" style="white-space:pre">        </span>init(x: Double, y: Double) {</font></p>
<p style="margin:0px;font-size:12px;line-height:normal"><font face="monospace, monospace" color="#000000"><span class="" style="white-space:pre">                </span>self.x = y</font></p>
<p style="margin:0px;font-size:12px;line-height:normal"><font face="monospace, monospace" color="#000000"><span class="" style="white-space:pre">                </span>self.y = y</font></p>
<p style="margin:0px;font-size:12px;line-height:normal"><font face="monospace, monospace" color="#000000"><span class="" style="white-space:pre">        </span>}</font></p>
<p style="margin:0px;font-size:12px;line-height:normal"><font face="monospace, monospace" color="#000000">}</font></p><p style="margin:0px;font-size:12px;line-height:normal"><font face="monospace, monospace" color="#000000"><br></font></p><p style="margin:0px;line-height:normal"><font color="#000000" face="monospace, monospace">I'm just curious as to why the <i>self</i> (in bold) is needed in the init() that's calling init(x: Double, y: Double)? Can't the compiler infer from the parameters what should be called?</font></p><p style="margin:0px;line-height:normal"><font color="#000000" face="monospace, monospace"><br></font></p><p style="margin:0px;line-height:normal"><font color="#000000" face="monospace, monospace">- Diego</font></p></div></div>