mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 12:24:49 +01:00
Fix #5028 - avoid false-positive on dynamic property fetch after ternary
This commit is contained in:
parent
eb3c014106
commit
245b944c85
@ -176,7 +176,8 @@ class InstancePropertyFetchAnalyzer
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($stmt_var_type->isNullable() && !$stmt_var_type->ignore_nullable_issues) {
|
if ($stmt_var_type->isNullable() && !$stmt_var_type->ignore_nullable_issues) {
|
||||||
if (!$context->inside_isset) {
|
// we can only be sure that the variable is possibly null if we know the var_id
|
||||||
|
if (!$context->inside_isset && $var_id) {
|
||||||
if (IssueBuffer::accepts(
|
if (IssueBuffer::accepts(
|
||||||
new PossiblyNullPropertyFetch(
|
new PossiblyNullPropertyFetch(
|
||||||
'Cannot get property on possibly null variable ' . $stmt_var_id . ' of type ' . $stmt_var_type,
|
'Cannot get property on possibly null variable ' . $stmt_var_id . ' of type ' . $stmt_var_type,
|
||||||
|
Loading…
Reference in New Issue
Block a user