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 use typescript version 1.8 (but this problem, there was Previous version and now version)
problem: show error when use difference two way call function.
error TS2345: Argument of type '{ color1: string; }' is not assignable to parameter of type 'SquareConfig'.
Object literal may only specify known properties, and 'color1' does not exist in type 'SquareConfig'.
The text was updated successfully, but these errors were encountered:
This seems like the effect of strict object literal assignment checking, introduced in TypeScript 1.6. It means that for the config parameter, only a literal containing the exact set of properties is allowed (optional properties are still optional). This restriction does not apply however when a non-literal, like a variable is passed to it. The reasoning for this is explained in the issue.
If the intention here is to allow additional properties on object literals when assigned to SquareConfig, an index signature can be added to the interface:
I use typescript version 1.8 (but this problem, there was Previous version and now version)
problem: show error when use difference two way call function.
two way call function and to reply
1.
is correct work
but
2.
above code produce error.
The text was updated successfully, but these errors were encountered: