Say you have a Typescript class
like this:
class CompExt extends Comp {
public static sum(a: number, b: number): number {return a+b};
};
The function sum will be sligtly different from the original class and it must be static.
Your actual code is
let ff: Function = CompExt;
console.log('the summ works fine',ff.sum(1,2));
Both the code editor and compilation will warn me this:
bas.ts(47,16): error TS2339: Property 'sum' does not exist on type 'Function'.
Is there a way to avoid compilation errors? If I use any
rather than Function
everthing is fine but I was wondering if Typescript supports such style.