1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 10:38:49 +01:00

Cast storage type to type

This commit is contained in:
Olle 2020-06-30 15:22:55 +00:00
parent a2faf70c0f
commit 4cd3c93d0d

View File

@ -412,7 +412,10 @@ class MethodCallAnalyzer extends \Psalm\Internal\Analyzer\Statements\Expression\
if ($codebase->methods->hasStorage($method_id)) {
$storage = $codebase->methods->getStorage($method_id);
if ($storage->self_out_type) {
$context->vars_in_scope[$lhs_var_id] = $storage->self_out_type;
// TODO: Safe cast?
/** @var \Psalm\Type\Union */
$self_out_type = $storage->self_out_type;
$context->vars_in_scope[$lhs_var_id] = $self_out_type;
}
}
}