diff --git a/src/Psalm/Type/Algebra.php b/src/Psalm/Type/Algebra.php index 6cdfd0c3906..ffa782b13a7 100644 --- a/src/Psalm/Type/Algebra.php +++ b/src/Psalm/Type/Algebra.php @@ -345,6 +345,19 @@ public static function getFormula( } } + if ($conditional instanceof PhpParser\Node\Expr\Cast\Bool_) { + return self::getFormula( + $conditional_object_id, + \spl_object_id($conditional->expr), + $conditional->expr, + $this_class_name, + $source, + $codebase, + $inside_negation, + $cache + ); + } + $assertions = null; if ($cache && $source instanceof \Psalm\Internal\Analyzer\StatementsAnalyzer) {