You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// A *self-contained* demonstration of the problem follows...functionf({ a =false, b ='/'}={}){}f(true);f('lol');f(5);
Expected behavior:
The 3 calls to f should fail at compile time.
Actual behavior:
The calls do not fail.
Comment:
I suppose that typescript consider that the argument to the function is an object. And thus the parameter available inside the function body will simply be this same object but with two extra properties a and b set to their default values.
It makes sense, but it seems completely counter-intuitive to the programmer expectations :)