<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 12, 2016, at 3:12 PM, Erica Sadun &lt;<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"></blockquote><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">I'm going to go with the classic answer:&nbsp;<a href="http://www.urbandictionary.com/define.php?term=Henny+Youngman+problem" class="">http://www.urbandictionary.com/define.php?term=Henny+Youngman+problem</a></div><div class=""><br class=""></div><div class="">consider:&nbsp;<span class="" style="font-family: Menlo;">let sale2 = sale</span></div><div class="">you could then run&nbsp;<font face="Menlo" class="">sale2(options: options)</font></div><div class=""><br class=""></div><div class="">So why should&nbsp;<font face="Menlo" class="">let sale = sale</font>&nbsp;be any different?</div></div></blockquote><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><br class=""></div><div class="">Shouldn't the use of the 'options' parameter label result in the function name not clashing with the generic 'sale'?</div><div class=""><br class=""></div><div class="">In the case of the error line itself, I would've assumed from the context that the compiler would know that I wanted to invoke the function named 'sale' rather than refer to the function in the abstract. The passing of the parameter value should be enough of a tip-off about that, no?</div><div class=""><br class=""></div><div class="">And from that line on within the local scope, I'd understand if a local variable named 'sale' shadowed a no-arg function also named 'sale', but given that this function is really named 'sale(options:)', I would've thought this'd work.</div><div class=""><br class=""></div><div class=""><br class=""></div></div></div><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class="">On May 12, 2016, at 1:07 PM, Evan Maloney via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Adopting the newer Swift style of preferring first parameter labels, I wrote a function:<br class=""><br class=""> &nbsp;&nbsp;&nbsp;func sale(options options: DeepLinkOptions)<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throws<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt; Sale<br class=""> &nbsp;&nbsp;&nbsp;{<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// ...implementation...<br class=""> &nbsp;&nbsp;&nbsp;}<br class=""><br class="">I then tried calling it elsewhere, and setting the result to a variable named 'sale', which is coincidentally the same name as the function above:<br class=""><br class=""> &nbsp;&nbsp;&nbsp;let sale = try sale(options: options)<br class=""><br class="">This line won't compile, failing with the following error and a caret pointing at the second use of 'sale':<br class=""><br class=""> &nbsp;&nbsp;&nbsp;variable used within its own initial value<br class=""><br class="">In the past, I would've named the function above according to Objective-C conventions, and it might've ended up with a name like 'saleWithOptions'; there'd be no clash. However, with the more terse Swift 3.0 style, we'll probably end up with more situations like mine.<br class=""><br class="">Is this (should this be?) considered a bug or compiler limitation? Should I file a JIRA? There doesn't seem to be anything for this on <a href="http://bugs.swift.org/" class="">bugs.swift.org</a> yet.<br class=""></div></div></blockquote><br class=""></div><div class="">I'm going to go with the classic answer:&nbsp;<a href="http://www.urbandictionary.com/define.php?term=Henny+Youngman+problem" class="">http://www.urbandictionary.com/define.php?term=Henny+Youngman+problem</a></div><div class=""><br class=""></div><div class="">consider:&nbsp;<span style="font-family: Menlo;" class="">let sale2 = sale</span></div><div class="">you could then run <font face="Menlo" class="">sale2(options: options)</font></div><div class=""><br class=""></div><div class="">So why should <font face="Menlo" class="">let sale = sale</font> be any different?</div></div></div></blockquote></div><br class=""></body></html>