[swift-evolution] Referencing zero-parameter functions

Chris Lattner clattner at apple.com
Thu May 5 15:36:34 CDT 2016


> On May 5, 2016, at 10:38 AM, Joe Groff <jgroff at apple.com> wrote:
> 
> 
>> On May 5, 2016, at 10:16 AM, Jordan Rose via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> 
>>> On May 5, 2016, at 10:03, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
>>> 
>>> On May 5, 2016, at 8:59 AM, Alex Hoppen via swift-evolution <swift-evolution at swift.org> wrote:
>>>> Say you have the function `foo() -> Int`. Then `foo()` calls `foo` and returns its return value of type `Int` – not a reference to the function of type `Void -> Int`. 
>>> 
>>> Right.
>>> 
>>> That said, what is wrong with just “foo”?
>> 
>> As pointed out in the original post, that can refer to both ‘foo()’ and ‘foo(bar:)’ today.
> 
> We could change that, so that to refer to `foo(bar:)` you must use the full compound name.

Right.  that seems like the most logical solution to this problem, if it is really significant enough to fix.

-Chris


More information about the swift-evolution mailing list