mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Clone all types on assignment
This commit is contained in:
parent
5d9ce5433a
commit
2ec09b26d2
@ -1132,6 +1132,8 @@ class CallChecker
|
||||
$class_type->from_docblock = false;
|
||||
|
||||
$context->removeVarFromConflictingClauses($var_id, null, $statements_checker);
|
||||
|
||||
$context->vars_in_scope[$var_id] = $class_type;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2649,6 +2651,8 @@ class CallChecker
|
||||
}
|
||||
|
||||
$context->removeVarFromConflictingClauses($var_id, null, $statements_checker);
|
||||
|
||||
$context->vars_in_scope[$var_id] = $input_type;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -552,7 +552,7 @@ class ExpressionChecker
|
||||
$context->vars_possibly_in_scope[$var_name] = true;
|
||||
$stmt->inferredType = Type::getMixed();
|
||||
} else {
|
||||
$stmt->inferredType = $context->vars_in_scope[$var_name];
|
||||
$stmt->inferredType = clone $context->vars_in_scope[$var_name];
|
||||
}
|
||||
} else {
|
||||
$stmt->inferredType = Type::getMixed();
|
||||
@ -669,7 +669,7 @@ class ExpressionChecker
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$stmt->inferredType = $context->vars_in_scope[$var_name];
|
||||
$stmt->inferredType = clone $context->vars_in_scope[$var_name];
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user