Skip to content

Missing error if DestructuringRestProperty is assigned to object or array literal #26005

@ajafff

Description

@ajafff

TypeScript Version: 3.1.0-dev.20180727

Search Terms: destructuring rest

Code

({...{}} = {});
({...[]} = []);

Expected behavior:

An error on both assignments as described in the Spec: https://tc39.github.io/ecma262/#sec-destructuring-assignment-static-semantics-early-errors

Actual behavior:

No error

Playground Link: https://agentcooper.github.io/typescript-play/#code/BQbwdBIL5QBAvLaBKA3AKFBMBtAunIvmkA

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions