<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">No, David, it is now allowed.  &quot;error: same-type requirement makes generic parameters &#39;Source&#39; and &#39;Displacement&#39; equivalent&quot;.</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">Zhao Xin</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 9, 2017 at 12:35 PM, David Sweeris via swift-users <span dir="ltr">&lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You could try putting that init in an extension &quot;where Source == Displacement&quot;<br>
<div class="HOEnZb"><div class="h5"><br>
&gt; On Jul 8, 2017, at 21:06, Taylor Swift via swift-users &lt;<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt; I have a type like<br>
&gt;<br>
&gt; struct DistortedNoise&lt;Source, Displacement&gt; where Source:Noise, Displacement:Noise<br>
&gt; {<br>
&gt;     let source:Source,<br>
&gt;         displacement:Displacement<br>
&gt;<br>
&gt;     init(source:Source, displacement:Displacement)<br>
&gt;     {<br>
&gt;         self.source       = source<br>
&gt;         self.displacement = displacement<br>
&gt;     }<br>
&gt;<br>
&gt;     init(source:Source)<br>
&gt;     {<br>
&gt;         self.source       = source<br>
&gt;         self.displacement = source<br>
&gt;     }<br>
&gt; }<br>
&gt;<br>
&gt; and I get the error<br>
&gt;<br>
&gt; Compile Swift Module &#39;Noise&#39; (5 sources)<br>
&gt; /home/taylor/noise/sources/<wbr>noise/noise.swift:576:29: error: &#39;Source&#39; is not convertible to &#39;Displacement&#39;<br>
&gt;         self.displacement = source<br>
&gt;                             ^~~~~~<br>
&gt;<br>
&gt; How do I tell Swift that I want the same type fulfilling both Source and Displacement?<br>
&gt;<br>
</div></div><div class="HOEnZb"><div class="h5">&gt; ______________________________<wbr>_________________<br>
&gt; swift-users mailing list<br>
&gt; <a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br>
______________________________<wbr>_________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br>
</div></div></blockquote></div><br></div>