Skip to content

Computed properties no throws if there is a duplicate #25758

Description

@cevek

TypeScript Version: 3.0.0-dev.20180712

Search Terms:

Code

const A = 'a';
const x = {[A]: 1, [A]: 'b'} // x is {[A]: string}

Expected behavior:
Duplicate declaration error

Actual behavior:
No error

Playground Link: https://www.typescriptlang.org/play/#src=const%20A%20%3D%20'a'%3B%0D%0Aconst%20x%20%3D%20%7B%5BA%5D%3A%201%2C%20%5BA%5D%3A%201%7D%0D%0A

Related Issues:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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