This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Description
TypeScript behaves unintuitively when a base class references its private static variable via a derived class, as follows:
class FooBase {
private static privateStatic: string = "unset";
testPrivateStatic(): void {
Foo.privateStatic = "set";
console.log(FooBase.privateStatic);
}
}
class Foo extends FooBase { }
// Logs "unset" but you'd expect it to log "set"
new FooBase().testPrivateStatic();
There is an issue open against TypeScript here, but until that's fixed (and after, for older versions of TypeScript), we should have a rule that prohibits referencing derived classes' private statics since the behavior of doing such is likely not what the developer expects.