<div dir="ltr">Hi Everyone, <div>I was playing around in Xcode 7.3 with this code...<span><span><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(136,132,113)"><span></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(136,132,113)"><span><span></span></span></p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:12.0px Helvetica;color:#454545"><br></p><div></div></span><div></div></span><span style="font-variant-ligatures: no-common-ligatures;"><b>/**</b></span><p></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(136,132,113)"><span style="font-variant-ligatures: no-common-ligatures;"><b> *  Represents a future value of type U, from a computation that has not been done yet.</b></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(136,132,113)"><span style="font-variant-ligatures: no-common-ligatures;"><b> */</b></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(238,232,228)"><b><span style="color:rgb(253,68,133)">public</span><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color:rgb(253,68,133)">struct</span><span style="font-variant-ligatures: no-common-ligatures;"> Promise&lt;T, U&gt; {</span></b></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(238,232,228)"><b><span style="font-variant-ligatures: no-common-ligatures;">    </span><span style="color:rgb(253,68,133)">var</span><span style="font-variant-ligatures: no-common-ligatures;"> futureValue: </span><span style="color:rgb(255,168,39)">T</span><span style="font-variant-ligatures: no-common-ligatures;"> -&gt; </span><span style="color:rgb(255,168,39)">U</span></b></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(238,232,228);min-height:13px"><span style="font-variant-ligatures: no-common-ligatures;"><b>    </b></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(238,232,228)"><b><span style="font-variant-ligatures: no-common-ligatures;">    </span><span style="color:rgb(253,68,133)">public</span><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color:rgb(253,68,133)">func</span><span style="font-variant-ligatures: no-common-ligatures;"> then&lt;T,U,V&gt;(closure: </span><span style="color:rgb(255,168,39)">U</span><span style="font-variant-ligatures: no-common-ligatures;"> -&gt; </span><span style="color:rgb(255,168,39)">V</span><span style="font-variant-ligatures: no-common-ligatures;">) -&gt; </span><span style="color:rgb(255,168,39)">Promise</span><span style="font-variant-ligatures: no-common-ligatures;">&lt;</span><span style="color:rgb(255,168,39)">T</span><span style="font-variant-ligatures: no-common-ligatures;">, </span><span style="color:rgb(255,168,39)">V</span><span style="font-variant-ligatures: no-common-ligatures;">&gt; {</span></b></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(238,232,228)"><b><span style="font-variant-ligatures: no-common-ligatures;">        </span><span style="color:rgb(253,68,133)">return</span><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color:rgb(255,168,39)">Promise</span><span style="font-variant-ligatures: no-common-ligatures;">&lt;</span><span style="color:rgb(255,168,39)">T</span><span style="font-variant-ligatures: no-common-ligatures;">, </span><span style="color:rgb(255,168,39)">V</span><span style="font-variant-ligatures: no-common-ligatures;">&gt;(futureValue: {</span></b></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(238,232,228)"><b><span style="font-variant-ligatures: no-common-ligatures;">            input </span><span style="color:rgb(253,68,133)">in</span></b></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(238,232,228)"><b><span style="font-variant-ligatures: no-common-ligatures;">            </span><span style="color:rgb(253,68,133)">let</span><span style="font-variant-ligatures: no-common-ligatures;"> value = futureValue(input)</span></b></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(238,232,228)"><b><span style="font-variant-ligatures: no-common-ligatures;">            </span><span style="color:rgb(253,68,133)">return</span><span style="font-variant-ligatures: no-common-ligatures;"> closure(value)</span></b></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(238,232,228)"><span style="font-variant-ligatures: no-common-ligatures;"><b>        })</b></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(238,232,228)"><span style="font-variant-ligatures: no-common-ligatures;"><b>    }</b></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(238,232,228)"><span style="font-variant-ligatures: no-common-ligatures;"><b>}</b></span></p><p></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(238,232,228);min-height:13px"><br></p><span style="color:rgb(0,0,0)">and came across the following error:</span></div><div><b style="color:rgb(238,232,228);font-family:Menlo;font-size:11px"><br></b></div><div><b style="color:rgb(238,232,228);font-family:Menlo;font-size:11px">error: cannot invoke value of type &#39;T -&gt; U&#39; with argument list &#39;((T))&#39;</b></div><div><br></div><div>Can someone explain what is going on here? It looks like my closure should be accepting a value of T, but for some reason the types aren&#39;t matching up.</div><div>Thanks, Blake</div><div><br></div></div>