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
Actual behavior:
Error:
Argument of type '{ type: "activate" | "disactivate"; }' is not assignable to parameter of type 'Action'.
Type '{ type: "activate" | "disactivate"; }' is not assignable to type '{ type: "disactivate"; }'.
Types of property 'type' are incompatible.
Type '"activate" | "disactivate"' is not assignable to type '"disactivate"'.
Type '"activate"' is not assignable to type '"disactivate"'.
The text was updated successfully, but these errors were encountered:
This is working as intended. I would suggest writing the declaration of type Action as follows to clearly indicate that the type property has two possible values regardless of the rest of the properties:
typeAction={type: 'activate'|'disactivate'};
In general, the unification you propose is only possible for a small subset of types. See my comment in #12052.
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.3.2
Code
Expected behavior:
Everything is correct. And if I change last line to:
then no errors will be produced.
Actual behavior:
Error:
Argument of type '{ type: "activate" | "disactivate"; }' is not assignable to parameter of type 'Action'.
Type '{ type: "activate" | "disactivate"; }' is not assignable to type '{ type: "disactivate"; }'.
Types of property 'type' are incompatible.
Type '"activate" | "disactivate"' is not assignable to type '"disactivate"'.
Type '"activate"' is not assignable to type '"disactivate"'.
The text was updated successfully, but these errors were encountered: