3 ms·
That case really is a type mismatch, so you would hope a decent static type system would catch it. However, you don’t see the same warning in the case of funct
by Chris_Newton 6y ago
That case really is a type mismatch, so you would hope a decent static type system would catch it.
However, you don’t see the same warning in the case of functions that can be called with variable numbers of arguments if the types of the arguments being unintentionally supplied do match, because within the rules of TS, this is working as designed.
Combined with the perhaps unfortunate decision to provide a standard `map` function that doesn’t use its callback as most languages do, there is still the potential for an unexpected change of behaviour that the type checker can’t warn you about here.