Given
const a = Symbol.toStringTag;
class F {
[a](){ return "" }
}
(new F())[a];
we currently issue a Element implicitly has an 'any' type because expression of type 'symbol' can't be used to index type 'F'.(7053) error on the access.
There should be no errors, as with
const a = Symbol();
class F {
[a](){ return "" }
}
(new F())[a];
since Symbol.toStringTag is a unique symbol just like what Symbol() makes.
Given
we currently issue a
Element implicitly has an 'any' type because expression of type 'symbol' can't be used to index type 'F'.(7053)error on the access.There should be no errors, as with
since
Symbol.toStringTagis aunique symboljust like whatSymbol()makes.