Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Indexing with symbols not yet supported - Symbols section #239

Closed
@gburdeti

Description

@gburdeti

The following code doesn't compile.

const getClassNameSymbol = Symbol();

class C {
    [getClassNameSymbol](){
       return "C";
    }
}

let c = new C();
let className = c[getClassNameSymbol](); // "C"

It's the last line that creates an error.

From what I can understand it is explained in issue #1863 of the TypeScript repo.

Based on @danquirk's and JsonFreeman's answers to wereHamster this feature is not yet supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions