When a static field is overridden in a derived class, it leads to an issue
Error TS2417: Build:Class static side 'typeof TDerived' incorrectly extends base class static side 'typeof TBase'
Is this a valid error scenario?
class TBase
{
private static s_field = 'something';
public constructor() {}
}
class TDerived extends TBase
{
private static s_field = 'something else'; // removing this line resolves the error
public constructor()
{
super();
}
}
What is the best approach for handling static fields? Currently, the only solution seems to be prefixing the class name before every static field, which is not ideal.
private static TBase_s_field = 'something';
...
private static TDerived_s_field = 'something else';
ps using typescript 2.0.3