From a67800cac7b66fda60ac5cf68da050b5839d26c3 Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Thu, 19 Jan 2017 15:00:05 -0500 Subject: [PATCH] Ignore cloning of mixed variables --- src/Psalm/Checker/Statements/ExpressionChecker.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Checker/Statements/ExpressionChecker.php b/src/Psalm/Checker/Statements/ExpressionChecker.php index bc64da303..ab5c4cfc5 100644 --- a/src/Psalm/Checker/Statements/ExpressionChecker.php +++ b/src/Psalm/Checker/Statements/ExpressionChecker.php @@ -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,