Files
swift-mirror/test/Parse/matching_patterns.swift
Robert Widmann ba7ae4aca9 [SR-5671] Emit diagnostic in place of collection downcast in pattern
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.
2017-08-11 15:00:31 -07:00

11 KiB