I encountered an issue with TypeScript while compiling the code snippet below:
class A {
public static then() {
return this;
}
}
class B extends A {
public static shouldWorks() { return 42; }
}
console.log(B.then().shouldWorks());
When I compile the script, the compiler throws the following error:
error TS2339: Property 'shouldWorks' does not exist on type 'typeof A'.
However, when I run the compiled script, it works fine!
Why is this happening?