From 9230b425e7ba32723275044d516e1fe7ed470427 Mon Sep 17 00:00:00 2001 From: Brown Date: Tue, 18 Feb 2020 12:12:34 -0500 Subject: [PATCH] Ors can still be created directly from conditions --- src/Psalm/Type/Algebra.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Type/Algebra.php b/src/Psalm/Type/Algebra.php index bb25aead2ee..0826800164d 100644 --- a/src/Psalm/Type/Algebra.php +++ b/src/Psalm/Type/Algebra.php @@ -705,6 +705,10 @@ public static function combineOredClauses(array $left_clauses, array $right_clau } } + $creating_object_id = $right_clause->creating_object_id === $left_clause->creating_object_id + ? $right_clause->creating_object_id + : null; + $clauses[] = new Clause( $possibilities, false, @@ -712,7 +716,9 @@ public static function combineOredClauses(array $left_clauses, array $right_clau $right_clause->generated || $left_clause->generated || count($left_clauses) > 1 - || count($right_clauses) > 1 + || count($right_clauses) > 1, + [], + $creating_object_id ); } }