error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== iterableWithNeverAsUnionMember.ts (0 errors) ====
    declare const o1: { a: "foo" } & { a: "bar" };
    const [el1] = o1; // error
    
    // https://github.com/microsoft/TypeScript/issues/62462
    declare var x: number[] | ({ t: "a" } & { t: "b" });
    let [el2] = x; // ok
    
    for (const elem of x) { // ok
      elem.toFixed();
    }
    
    type Shape =
      | { kind: "circle"; radius: number }
      | { kind: "rectangle"; width: number; height: number };
    
    type Circle = Shape & { kind: "circle" };
    
    function doStuffWithCircle(arg: Circle | [Circle, (newValue: Circle) => void]) {
      if (Array.isArray(arg)) {
        let [value, setValue] = arg; // ok
      }
    }
    
    function f1<T extends { a: "foo" } & { a: "bar" }>(x: T) {
      let [y] = x; // error
    }
    
    declare const o2: ({ a: "foo" } & { a: "bar" }) | ({ b: "qwe" } & { b: "rty" });
    const [el3] = o2; // error