[swift-evolution] [proposal] Allow function argument type to be omitted when passing a default value from which it can be inferred

Chris Lattner clattner at apple.com
Wed May 11 13:03:55 CDT 2016


> On May 11, 2016, at 5:49 AM, Vladimir.S via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Inline
> 
> On 11.05.2016 15:09, Thorsten Seitz via swift-evolution wrote:
>> Am 11. Mai 2016 um 05:33 schrieb Chris Lattner via swift-evolution
>> <swift-evolution at swift.org>:
>> 
>>> On May 10, 2016, at 3:02 AM, Sam Dods via swift-evolution
>>> <swift-evolution at swift.org> wrote:
>>>> I propose that function argument types could be omitted in the same way
>>>> as variable and property argument types are omitted when they are set at
>>>> point of definition.
>>>> [...]
>>> 
>>> We have a pretty strict rule here: types are allowed to be inferred in
>>> implementations, but not interfaces. This is important for efficient
>>> compilation, encourages people to think about their API interfaces, and
>>> somewhat reduces the damage when they don’t.
>> 
>> +1
> 
> Sorry, but this("We have a pretty strict rule") seems just like not true. The rule is broken as you can see (so not such a 'strict') :

Yes, I’m aware of that, that’s why I used the waffly word “pretty” :-)

-Chris


More information about the swift-evolution mailing list