narrowSwitchOptionalChainContainmentEvolvingArrayNoCrash1.ts(1,5): error TS7034: Variable 'foo' implicitly has type 'any[]' in some locations where its type cannot be determined.
narrowSwitchOptionalChainContainmentEvolvingArrayNoCrash1.ts(5,5): error TS7005: Variable 'foo' implicitly has an 'any[]' type.


==== narrowSwitchOptionalChainContainmentEvolvingArrayNoCrash1.ts (2 errors) ====
    let foo = [];
        ~~~
!!! error TS7034: Variable 'foo' implicitly has type 'any[]' in some locations where its type cannot be determined.
    
    switch (foo?.length) {
      case 1:
        foo[0];
        ~~~
!!! error TS7005: Variable 'foo' implicitly has an 'any[]' type.
    }
    
    let bar = [];
    
    switch (bar?.length) {
      case 1: {
        bar.push("baz");
        const arr: string[] = bar;
      }
    }
    