[swift-evolution] "where" on a switch case with multiple items is misleading

Amir Michail a.michail at me.com
Fri Mar 11 06:42:21 CST 2016


Consider:

switch x { 
	case a, b where …: ...
}

this currently means:

switch x { 
	case a where true, b where …: ...
}

Most people would probably think the “where" applies to both a and b.

To avoid this confusion, maybe if “where" is used for one item then it should be required for all items in that case?



More information about the swift-evolution mailing list