TypeScript/tests/cases/compiler/destructuredLateBoundNameHasCorrectTypes.ts
Wesley Wigham b2e0c4bea6
Add support for destructuring well-known and late-bound names (#23297)
* Add support for destructuring well-known and late-bound names

* Add test of not present late bound prop
2018-04-10 18:21:24 -07:00

13 lines
254 B
TypeScript

// @target: es6
let { [Symbol.iterator]: destructured } = [];
void destructured;
const named = "prop";
let { [named]: computed } = { prop: "b" };
void computed;
const notPresent = "prop2";
let { [notPresent]: computed2 } = { prop: "b" };