1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +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,17 +1305,22 @@ 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
);
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) {
if ($return_type->fq_classlike_name === 'self' && $self_class) {