TypeScript Class Method Overriding with Static Properties and Their Impact on Inheritance
I'm working with an scenario when trying to override a method in a TypeScript class that also uses static properties. I have a base class with a static property and a method that utilizes this property. When I create a derived class and override the method, the behavior doesn't match my expectations, especially regarding how the static property is accessed. Here's a simplified version of my code: ```typescript class Base { static baseValue: number = 100; getValue(): number { return Base.baseValue; } } class Derived extends Base { static baseValue: number = 200; getValue(): number { return Derived.baseValue; } } const derivedInstance = new Derived(); console.log(derivedInstance.getValue()); // What I expect: 200, but I get: 100 ``` When I call `getValue()` on an instance of `Derived`, it seems to reference the static property of the `Base` class instead of the overridden static property in `Derived`. I've verified that the static properties are correctly defined, and I've tried using `super` to access the base class value, but that doesn't seem to solve my question. Also, I'm using TypeScript version 4.5.2 and targeting ES6. Am I misunderstanding how static properties work with inheritance in TypeScript, or is there a better way to structure my classes to achieve the desired behavior?