error TS-1: Pre-emit (4) and post-emit (1) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here!
iterationErrorOverNotIterableUnions1.ts(17,13): error TS7053: Element implicitly has an 'any' type because expression of type '0' can't be used to index type 'A[] | B'.
  Property '0' does not exist on type 'A[] | B'.


!!! error TS-1: Pre-emit (4) and post-emit (1) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here!
!!! related TS-1: The excess diagnostics are:
!!! related TS2488 iterationErrorOverNotIterableUnions1.ts:6:20: Type 'A[] | B' must have a '[Symbol.iterator]()' method that returns an iterator.
!!! related TS2488 iterationErrorOverNotIterableUnions1.ts:10:27: Type 'A[] | B' must have a '[Symbol.iterator]()' method that returns an iterator.
!!! related TS2488 iterationErrorOverNotIterableUnions1.ts:14:7: Type 'A[] | B' must have a '[Symbol.iterator]()' method that returns an iterator.
==== iterationErrorOverNotIterableUnions1.ts (1 errors) ====
    type A = { a: string };
    type B = { b: string };
    
    declare const data: A[] | B;
    
    for (const item of data) {
        item.b;
    }
    
    for (const ignoredItem of data) {
        ignoredItem.b;
    }
    
    const [el] = data;
    el.b;
    
    const el2 = data[0];
                ~~~~~~~
!!! error TS7053: Element implicitly has an 'any' type because expression of type '0' can't be used to index type 'A[] | B'.
!!! error TS7053:   Property '0' does not exist on type 'A[] | B'.
    el2.b;
    