1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Use mixed if yield type not known

This commit is contained in:
Matthew Brown 2020-04-04 23:54:41 -04:00
parent 120595f480
commit 4c52032491

View File

@ -1928,16 +1928,16 @@ class ExpressionAnalyzer
$classlike_storage = $codebase->classlike_storage_provider->get($expression_atomic_type->value);
if ($classlike_storage->yield) {
$yield_type = clone $classlike_storage->yield;
if ($expression_atomic_type instanceof Type\Atomic\TGenericObject) {
$yield_type = PropertyFetchAnalyzer::localizePropertyType(
$codebase,
$yield_type,
clone $classlike_storage->yield,
$expression_atomic_type,
$classlike_storage,
$classlike_storage
);
} else {
$yield_type = Type::getMixed();
}
$expression_type->substitute($expression_type, $yield_type);