Skip to content

Invalid rename in rest binding of object destructuring #39421

Description

@ravshansbox

TypeScript Version: 4.0.0-dev.20200704

Search Terms: rename, rest binding, object destructuring

Code

const foo = ({ param1, ...rest }) => {
  console.log(rest);
};

Rename rest binding to rest1

Expected behavior:

const foo = ({ param1, ...rest1 }) => {
  console.log(rest1);
};

Actual behavior:

const foo = ({ param1, ...rest: rest1 }) => {
  console.log(rest1);
};

Activity

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

    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