declare function isArrayLike(value: any): value is { length: number };
declare const value: { [index: number]: boolean, length: number } | undefined;
if (isArrayLike(value)) {
const result: { length: number } = value;
} else {
const result: undefined = value;
}
Before #52282: value: undefined in the false branch.
After #52282: value: { [index: number]: boolean, length: number } | undefined in the false branch.
This is more consistent, although the full repro at DefinitelyTyped/DefinitelyTyped#64406 seems less consistent than the 4.9 semantics.
Before #52282:
value: undefinedin the false branch.After #52282:
value: { [index: number]: boolean, length: number } | undefinedin the false branch.This is more consistent, although the full repro at DefinitelyTyped/DefinitelyTyped#64406 seems less consistent than the 4.9 semantics.