Skip to content

Invalid quickfix output for code fix all for infer type from usage #24148

Description

TypeScript Version: 2.9.0-dev.201xxxxx

Search Terms:

Code

letx=null;functionfoo(){if(!x){// CodeFix allx=22;}}functionbar(){console.log(x);}

Expected behavior:

letx: number|null=null;functionfoo(){if(!x){x=22;}}functionbar(){console.log(x);}

Actual behavior:

letx: number: number: number=null;functionfoo(){if(!x){x=22;}}functionbar(){console.log(x);}

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions