Repository navigation
How to let Psalm know that some method asserts a variable type? #6163
Unanswered
fluffycondor
asked this question in
Q&A
Replies: 1 comment 2 replies
|
This solves the issue: But I would have expected the @psalm-assert-if-true to be located on Comparable instead of Foo for this to work. This makes it possible to do that kind of nonsense: https://psalm.dev/r/b8f9c6f6eb |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Let's say I have code like this:
https://psalm.dev/r/38611b4f08
On line 24 there are two false-positives:
$objectisFoofor sure, but Psalm still thinks it's justComparable.How can I let Psalm know that if that method returns true, the first argument has the same type as
$thishas?All reactions