TypeScript/tests/cases/compiler/destructuringPropertyAssignmentNameIsNotAssignmentTarget.ts
Nathan Shively-Sanders cabcaaadcb Property assignment is not an assignment target
In a destructuring assignment, a property assignment is not an
assignment target. Its initialiser is. For example:

```ts
({ source: target} = o);
```

Here, `target` is the assignment target. `source` is not. Previously,
both were assignment targets.
2017-01-26 16:08:55 -08:00

8 lines
133 B
TypeScript

// test for #10668
function qux(bar: { value: number }) {
let foo: number;
({ value: foo } = bar);
let x = () => bar;
}