unique symbol
s from the global SymbolConstructor
widen way too eagerlyย #53276
Open
Description
opened on Mar 15, 2023
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.
Activity