-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Milestone
Description
This works as expected: https://phpstan.org/r/c11d6f2d-ce6b-4338-a7fc-6bd6695c25cd
The abc() accepts a shape with extra keys.
However, if I update parameter type of abc() to make some of its keys optional, PHPStan complains: https://phpstan.org/r/82e97898-71bf-496b-abe9-0d79f7caf757
And it complains even if the given key is optional in both parameter and argument types: https://phpstan.org/r/7ac7677c-c1f9-4393-bd44-e70ef3d5935e
Expected behaviour
An array shape can accept another array shape with extra keys and the accepting type can have its keys optional regardless of their optionality in the assigned type.
Reactions are currently unavailable