TypeScript Version: 2.3.4
Code
functionexample(parameter: {value: "a"}){// Function requires argument with string literalreturn;}varmyObject={value: "a"// TS infers value to be string here, causing problems passing this object to function};example(myObject);// Error: Argument of type '{ value: string; }' is not assignable to parameter of type 'ObjectType'. Types of property 'value' are incompatible. Type 'string' is not assignable to type '"a"'.Expected behavior:
No compiler error
Actual behavior:
Compiler error (see self-contained example)
TypeScript Version: 2.3.4
Code
Expected behavior:
No compiler error
Actual behavior:
Compiler error (see self-contained example)