Skip to content

diagnostic regression - unused variables from destructuring with rename  #24142

@jkillian

Description

@jkillian

TypeScript Version: 2.9.0-dev.20180509 and up

Code

export function testRenamingDestructure() {
  let {a: b} = {a: 4};
}

Expected behavior:

Error produced in 2.9.0-dev.20180506 and before:

test.ts:2:8 - error TS6133: 'b' is declared but its value is never read.

2   let {a: b} = {a: 4};
         ~~~~

Actual behavior:

Error produced in 2.9.0-dev.20180509 and after:

test.ts:2:7 - error TS6133: 'a' is declared but its value is never read.

2   let {a: b} = {a: 4};
        ~~~~~~

Description:

Our TSLint tests based off of TypeScript@next started breaking a few days ago. I tracked one of the breaks down to the change in error messages noted above. The older error message seems more correct here - in the example above, a cannot actually be accessed.

Related Issues: Possibly related to #23805?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions