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