Skip to content
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 opened this issue Apr 10, 2016 · 2 comments
Closed

Indexing with symbols not yet supported - Symbols section #239

gburdeti opened this issue Apr 10, 2016 · 2 comments
Labels

Comments

@gburdeti
Copy link
Contributor

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.

@gburdeti
Copy link
Contributor Author

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

@gburdeti
Copy link
Contributor Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants