Skip to content

TS looses previously determined type #48901

Closed

Activity

IllusionMH

IllusionMH commented on Apr 21, 2022

@IllusionMH
Contributor

Looks like not the first case for Array.isArray and IAction combo
#41889
#39258

transferred this issue frommicrosoft/vscodeon Apr 30, 2022
mjbvz

mjbvz commented on Apr 30, 2022

@mjbvz
Contributor

Self contained example:

let errorActions: readonly string[] | undefined = undefined;
if (Array.isArray(errorActions)) {
    // check errorActions here
    console.log(errorActions)
}
removed their assignment
on Apr 30, 2022
andrewbranch

andrewbranch commented on May 2, 2022

@andrewbranch
Member

Duplicate of #17002

typescript-bot

typescript-bot commented on May 5, 2022

@typescript-bot
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @bpasero@IllusionMH@andrewbranch@mjbvz@typescript-bot

        Issue actions

          TS looses previously determined type · Issue #48901 · microsoft/TypeScript