[swift-evolution] Spread Operator as Shorthand for Map
Matthew Johnson
matthew at anandabits.com
Wed Dec 16 23:33:18 CST 2015
>>
>> 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.
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.
> My general stance remains that, while an interesting idea, adding a second behavior around dot abbreviation causes more confusion than it's worth (especially given that the behavior is not well understood—this thread being an example), and that {$0.whatever} is not a big burden over (.whatever).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151216/7f3c3b2a/attachment.html>
More information about the swift-evolution
mailing list