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

Description

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 Dan Quirk (@danquirk)'s and JsonFreeman's answers to wereHamster this feature is not yet supported.

Activity

  1. gburdeti commented on Apr 10, 2016

    @gburdeti
    ContributorAuthor

    Nevermind, this code compiles correctly if noImplicitAny is set to false.

  2. gburdeti commented on Apr 11, 2016

    @gburdeti
    ContributorAuthor

    Reopened based on comment from Nathan Shively-Sanders (@sandersn) in pull request #240 stating that examples need to be clean for "noImplicitAny": true.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions