Skip to content

Why TypeScript ReturnType returned sequence is unstable in vscode #51517

Closed
@Eve-Sama

Description

@Eve-Sama

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.73.0 (Universal)
  • OS Version: Mac 12.5.1

Steps to Reproduce:

type A = () => 'a';
type B = () => 'b';
type Res1 = ReturnType<A | B>;
type Res2 = ReturnType<B | A>;

It's weird that above code run in vscode. I think the Res1 and Res2 is different. But they always keep same output. Sometimes they are 'a' | 'b', sometimes they are 'b' | 'a'. I have to restart vscode window or restart ts server trying to get right output. Is this a vscode bug?

图片

图片

Metadata

Metadata

Assignees

No one assigned

    Labels

    Not a DefectThis behavior is one of several equally-correct options

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions