Open fluffycondor opened 3 years ago
I found these snippets:
Seems to be constructor-specific: https://psalm.dev/r/5ced18e821
I found these snippets:
@weirdan we have the same problem, $this->logger is a LoggerInterface or null as a property, the constructor then sets it to be an instance of NullLogger from the psr package, however we still get a possibly null value response.
I can replicate this simply in this snippet: https://psalm.dev/r/769852b21a
I found these snippets:
I think it is not constructor related as it also happens in other functions: https://psalm.dev/r/db552ea25f
I found these snippets:
@MisatoTremor your snippet is indeed error prone. Nothing exclude errors if the getter is not pure: https://psalm.dev/r/96c247415c
I found these snippets:
This example from the original issue has gotten stranger, the trace is happening twice with different types...
I found these snippets:
Could this issue be related to my issue?
@MisatoTremor your snippet is indeed error prone. Nothing exclude errors if the getter is not pure: https://psalm.dev/r/96c247415c
Thanks, now I get it! But that applies to the original issue as well, as it follows the same principle. So this is not a false-positive at all
I found these snippets:
https://psalm.dev/r/6cfd65652c
Expected: no errors. Got: PossiblyNullReference
Something really unexplainable is going on here 🤔 Psalm correctly deducts that Foo::getDate() returns only DateTimeImmutable in this branch, but on the very next line it threats the result as DateTimeImmutable|null. The class Foo is marked as immutable as well.