mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
For switch statements like the following
class Animal {}
class Cat : Animal {}
class Dog : Animal {}
func check(_ arry: [Animal]) {
switch arry {
case is [Cat]:
()
case let dogs as [Dog]:
()
default:
()
}
}
Collection downcasts are not implemented. SILGen support requires
refactoring SILGenPattern to emit the collection downcast, but
would be better solved by a future rewrite.
At least offer a more informative diagnostic than what was there
before.
11 KiB
11 KiB