Skip to content

Quickfix for unused arrow function parameter results in invalid code #18274

Closed

Description

TypeScript Version: nightly (typescript@2.6.0-dev.20170906)

Code

const f = x => 1;

Apply the Remove declaration for 'x' quickfix.

Expected behavior:

const f = () => 1;

Actual behavior:

const f = => 1;

Activity

  1. ghost added
    BugA bug in TypeScript
    on Sep 6, 2017
  2. ghost added
    Domain: LS: Quick FixesEditor-provided fixes, often called code actions.
    on Sep 6, 2017
  3. ghost removed
    Domain: LS: Quick FixesEditor-provided fixes, often called code actions.
    on Sep 6, 2017
  4. amcasey commented on Sep 18, 2017

    @amcasey
    Member

    It turns out that our infrastructure is not well-suited to synthesizing the required parameters. We think that the emitter might do the right thing if we deleted the parameter list entry, but it might not and there would still be trivia issues.

    TL;DR: This might be non-trivial.

  5. locked and limited conversation to collaborators on Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptDomain: LS: Quick FixesEditor-provided fixes, often called code actions.FixedA PR has been merged for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions