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
I have noticed a problem with type inference of literal objects. Given example where alignment property should be of type "left" but it is string instead and it is not accepted by the given printText function when it is passed as a variable params but work when it is specified directly at the function invocation. Does this work as intended or is it a bug?
A sensible rule (perhaps enforced with tslint?) is that when you assign a created object literal to a variable it should always be typed. Only then the "object literal may only specify known properties" check will work too, informing you about obsolete properties when you removed it from the type but not in the code.
I have noticed a problem with type inference of literal objects. Given example where alignment property should be of type "left" but it is string instead and it is not accepted by the given
printText
function when it is passed as a variableparams
but work when it is specified directly at the function invocation. Does this work as intended or is it a bug?Tested with Typescript 2.8.
The text was updated successfully, but these errors were encountered: