Skip to content

object destructuring assignment with rename throws error #10668

@effervescentia

Description

@effervescentia

TypeScript Version: 2.0.2 (and 2.1.0-dev.20160830)

Code

// A *self-contained* demonstration of the problem follows...

let _value: SomeType;
let _other: OtherType;

({ value: _value, other: _other } = someFunction());

Expected behavior:
_value should be set to the value value returned in the result of someFunction()
same with _other

(this works in 2.0.0 and 2.0.0-dev.20160628)

Actual behavior:
Throws errors:
error: cannot find name 'value'
error: cannot find name 'other'

Metadata

Metadata

Assignees

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