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
functionmyValueArg(arg: "value"){}functionmyStringArg(arg: string){}namespacens{// Not needed, but shows it's not scope relatedletstr="value";if(str==="value"){myValueArg(str);[].forEach(()=>{myValueArg(str);// Argument of type 'string' is not assignable to parameter of type '"value"'.});}else{myStringArg(str);[].forEach(()=>{myStringArg(str);});}}
Expected behavior:
No warnings: the value (and type) of str has not changed.
Actual behavior:
Warning Argument of type 'string' is not assignable to parameter of type '"value"'.