1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Fix coercion

This commit is contained in:
Matthew Brown 2020-03-09 01:32:27 -04:00
parent 3243819f1b
commit 5b7ab6a542

View File

@ -1305,16 +1305,21 @@ class ExpressionAnalyzer
if ($return_type instanceof Type\Atomic\TClassString
&& $return_type->as_type
) {
$new_as_type = $return_type->as_type;
self::fleshOutAtomicType(
$codebase,
$return_type->as_type,
$new_as_type,
$self_class,
$static_class_type,
$parent_class,
$evaluate
);
$return_type->as = $return_type->as_type->value;
if ($new_as_type instanceof TNamedObject) {
$return_type->as_type = $new_as_type;
$return_type->as = $return_type->as_type->value;
}
}
if ($return_type instanceof Type\Atomic\TScalarClassConstant) {