Skip to content

'Add missing properties' quick fix incorrectly handles symbol property #49546

Closed
@mjbvz

Description

@mjbvz

Bug Report

🔎 Search Terms

  • quick fix
  • code action
  • add missing properties

🕗 Version & Regression Information

4.8.0-dev.20220614, not a regression

💻 Code

For the code:

const x: Iterable<number> = {}

Trigger the quick fix for add missing properties on x

🙁 Actual behavior

const x: Iterable<number> = {
    "__@iterator@15": function (): Iterator<number, any, undefined> {
        throw new Error("Function not implemented.");
    }
}

🙂 Expected behavior

const x: Iterable<number> = {
    [Symbol.iterator]: function (): Iterator<number, any, undefined> {
        throw new Error("Function not implemented.");
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions