1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 09:19:40 +01:00

qa: use $assertion_var_id over $arg_var_id for better type reflection

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This commit is contained in:
Maximilian Bösing 2022-06-12 01:33:13 +02:00
parent 6c1ed90dc1
commit e13268f5c0
No known key found for this signature in database
GPG Key ID: 9A8988C93CEC81A3

View File

@ -793,8 +793,8 @@ class CallAnalyzer
); );
} }
} }
} elseif (isset($arg_var_id) && isset($context->vars_in_scope[$arg_var_id])) { } elseif (isset($context->vars_in_scope[$assertion_var_id])) {
$other_type = $context->vars_in_scope[$arg_var_id]; $other_type = $context->vars_in_scope[$assertion_var_id];
if (self::isNewTypeNarrowingDownOldType($other_type, $union)) { if (self::isNewTypeNarrowingDownOldType($other_type, $union)) {
foreach ($union->getAtomicTypes() as $atomic_type) { foreach ($union->getAtomicTypes() as $atomic_type) {
if ($assertion_type instanceof TTemplateParam if ($assertion_type instanceof TTemplateParam