-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Milestone
Description
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.
Metadata
Metadata
Assignees
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.