Why there aren't any compilation errors in this code? Code:
function partial(f: (a: string) => string, a: string) : string {
return "";
}
var test = () => "";
var result = partial(test, "");
Function "partial" takes as the first argument a function, that takes one parameter, but I pass to it function, that doesn't take any parameters, and typescript compiler thinks, that this is OK. I understand that this can't break anything because you can pass all parameters in the world to the function that doesn't take any, and it won't break anything, but it should be a compilation error because typescript is about types and there is an obvious type missmatch and it can possible be a developer's error.
Is there any workarounds for this problem?