-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected TypeDoesNotContainType with optional array keys #2681
Labels
Comments
I found these snippets: https://psalm.dev/r/d082e5d948<?php
$d = [];
if (!rand(0,1)) {
$d['r'] = 'a';
}
if (empty($d['r'])) {
}
|
kkmuffme
added a commit
to kkmuffme/psalm
that referenced
this issue
Jan 13, 2024
…hen not validated Fix https://psalm.dev/r/b153d0d248 to return 'a'|null instead of 'a' - this is required as otherwise empty would report RedundantCondition errors now which would bring back vimeo#2681
kkmuffme
added a commit
to kkmuffme/psalm
that referenced
this issue
Jan 13, 2024
…hen not validated Fix https://psalm.dev/r/b153d0d248 to return 'a'|null instead of 'a' - this is required as otherwise empty would report RedundantCondition errors now which would bring back vimeo#2681
kkmuffme
added a commit
to kkmuffme/psalm
that referenced
this issue
Jan 13, 2024
…hen not validated Fix https://psalm.dev/r/b153d0d248 to return 'a'|null instead of 'a' - this is required as otherwise empty would report RedundantCondition errors now which would bring back vimeo#2681
kkmuffme
added a commit
to kkmuffme/psalm
that referenced
this issue
Jan 15, 2024
…hen not validated Fix https://psalm.dev/r/b153d0d248 to return 'a'|null instead of 'a' - this is required as otherwise empty would report RedundantCondition errors now which would bring back vimeo#2681
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://psalm.dev/r/d082e5d948
Expected: no issue, as
$d['r']
may be empty (not initialized)The text was updated successfully, but these errors were encountered: