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

Ignore cloning of mixed variables

This commit is contained in:
Matt Brown 2017-01-19 15:00:05 -05:00
parent 2a8e51f544
commit a67800cac7

View File

@ -1697,7 +1697,10 @@ class ExpressionChecker
if (isset($stmt->expr->inferredType)) {
foreach ($stmt->expr->inferredType->types as $clone_type_part) {
if (!$clone_type_part instanceof TNamedObject && !$clone_type_part instanceof TObject) {
if (!$clone_type_part instanceof TNamedObject &&
!$clone_type_part instanceof TObject &&
!$clone_type_part instanceof TMixed
) {
if (IssueBuffer::accepts(
new InvalidClone(
'Cannot clone ' . $clone_type_part,