tests/cases/compiler/arrayDestructuringInSwitch2.ts(11,13): error TS2488: Type 'never' must have a '[Symbol.iterator]()' method that returns an iterator.


==== tests/cases/compiler/arrayDestructuringInSwitch2.ts (1 errors) ====
    type X = { kind: "a", a: [1] } | { kind: "b", a: [] }
    
    function foo(x: X): 1 {
      const { kind, a } = x;
      switch (kind) {
        case "a":
          return a[0];
        case "b":
          return 1;
        default:
          const [n] = a;
                ~~~
!!! error TS2488: Type 'never' must have a '[Symbol.iterator]()' method that returns an iterator.
          return a;
      }
    }