Open boesing opened 1 year ago
I found these snippets:
It seems only be related to the assertion
. When I use the type as an argument-type for a method, I also get an issue regarding the value-of
field:
I found these snippets:
@boesing could this have been resolved (or partially resolved) by your recent PR?
Yeah, at least the InvalidArgument
to RelationEnum::from
is fixed.
Re-posting the psalm.dev link here to provide an updated comment of @psalm-github-bot:
https://psalm.dev/r/1729c5f430
-Psalm output (using commit 9921625):
-
-ERROR: InvalidArgument - 23:22 - Argument 1 of RelationEnum::from expects int|string, but value-of<RelationEnum> provided
+Psalm output (using commit d3463e3):
ERROR: InvalidArgument - 24:20 - Argument 1 of FooBar::bar expects array{foo: array{bar: array{relation: 'bar'|'foo'}}}, but array{foo: array{bar: array{relation: value-of<RelationEnum>}}} provided
-INFO: UnusedParam - 31:32 - Param $value is never referenced in this method
+INFO: UnusedParam - 31:32 - Param value is never referenced in this method
-INFO: UnusedParam - 37:35 - Param $value is never referenced in this method
+INFO: UnusedParam - 37:35 - Param value is never referenced in this method
-INFO: UnusedParam - 42:46 - Param $value is never referenced in this method
+INFO: UnusedParam - 42:46 - Param value is never referenced in this method
Hey there,
I try to do an array shape assertion. Somehow, psalm does not properly handle
value-of<Enum>
within that array shape and thus, I end up getting an issue. It seems to work when directly asserting the value withvalue-of<Enum>
tho and thus, I guess there might be some codepath missing to resolvevalue-of
properly.https://psalm.dev/r/eba33fb727