Since updating Typescript to 3.x I can not compile this class anymore:
class MyClass<T>{
private myMethods: [(val: T) => void] = [] as [(val: T) => void];
}
More specific, it is [] as [(val: T) => void]
that triggers the error and the compiler message is:
Error:(7, 47) TS2352: Type '[]' cannot be converted to type '[(val: T) => void]'.
Property '0' is missing in type '[]'.
It DO work in Typescript 2.9.2 though!
So what is the problem here and how do I solve it?