[swift-evolution] Spread Operator as Shorthand for Map

Stephen Celis stephen.celis at gmail.com
Thu Dec 17 06:47:38 CST 2015


> On Dec 17, 2015, at 12:33 AM, Matthew Johnson <matthew at anandabits.com> wrote:
> 
>>> If you remove that overload your code will fail to compile.  This is because the dot abbreviation is context sensitive.  It only works when the type system knows the type the expression is expected to produce.
>> 
>> Of course :) And if the overload stays and your suggested syntax were added, it would be ambiguous and also fail to compile.
> 
> This is not true.  They would have different types and therefore would not be ambiguous.

It's true in my example, but my example is an unlikely, type-ambiguous situation and is unlikely to occur in usage.

> But it’s not central to your position anyway since you are opposed on the grounds of potential for confusion rather than actual ambiguity.  :)  That is a fair and reasonable position with or without ambiguity.

I'm not opposed to the idea if it has broad applications and the type resolution is predictable. I think I'm probably doing a bad job of predicting.

Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151217/cfc28639/attachment.html>


More information about the swift-evolution mailing list