mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix #289, make inferred type of yield from expressions mixed
This commit is contained in:
parent
23e4c8f68b
commit
2e6b93e4d0
@ -1961,7 +1961,8 @@ class ExpressionChecker
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($stmt->expr->inferredType)) {
|
if (isset($stmt->expr->inferredType)) {
|
||||||
$stmt->inferredType = $stmt->expr->inferredType;
|
// this should be whatever the generator above returns, but *not* the return type
|
||||||
|
$stmt->inferredType = Type::getMixed();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -243,6 +243,7 @@ class Php70Test extends TestCase
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
function foo() : Generator {
|
function foo() : Generator {
|
||||||
|
/** @var int */
|
||||||
$value = yield from other_generator();
|
$value = yield from other_generator();
|
||||||
var_export($value);
|
var_export($value);
|
||||||
}',
|
}',
|
||||||
|
Loading…
Reference in New Issue
Block a user