Closed
Description
Categorizing breaks we've seen from this
type Comparable = string | undefined | Array<string>;
export function check<T extends Comparable>(a: T) {
if (Array.isArray(a)) {
// 4.0: m: string
// 4.1: Error, cannot index
const m = a[0];
}
}
const aggregatedResults: (number[] | null | 'loading')[] = [[1, 2], null, [3, 4], 'loading', [5, 6]]
// 4.0: onlyTheArrays: number[][]
// 4:1 Error, no overload matches this
const onlyTheArrays = aggregatedResults.filter<number[]>(Array.isArray) // number[][]