TypeScript Version: 2.2.1
Code
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"'.
TypeScript Version: 2.2.1
Code
Expected behavior:
No warnings: the value (and type) of
strhas not changed.Actual behavior:
Warning
Argument of type 'string' is not assignable to parameter of type '"value"'.