[swift-evolution] [SE-0155][Discuss] The role of labels in enum case patterns

Matthew Johnson matthew at anandabits.com
Tue Sep 5 07:28:29 CDT 2017


> On Sep 5, 2017, at 3:07 AM, gs. via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> This becomes false in exactly the situation that you described where there are two projections with similar structure, no? Labels would remove ambiguity here. 
> TJ 

That depends on what names are bound.  If the bound names clearly indicate which projection is matched that is not the case.  Further, the projections themselves would probable have a different base name which was used in the pattern.

> 
>> On Sep 4, 2017, at 19:35, Matthew Johnson <matthew at anandabits.com> wrote:
>> 
>> If the bound name clearly communicates the purpose of the associated value a label cannot add any additional clarity, it can only reduce clarity
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list