diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php index 706534fbbe5..a1df71add81 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php @@ -902,7 +902,7 @@ public static function verifyType( $input_type, $param_type, true, - true, + !isset($param_type->getAtomicTypes()['true']), $union_comparison_results, ); diff --git a/tests/FunctionCallTest.php b/tests/FunctionCallTest.php index f712af9dacd..2b73d655018 100644 --- a/tests/FunctionCallTest.php +++ b/tests/FunctionCallTest.php @@ -2358,6 +2358,17 @@ function fooFoo(int $a): void {} fooFoo("string");', 'error_message' => 'InvalidArgument', ], + 'invalidArgumentFalseTrueExpected' => [ + 'code' => ' 'InvalidArgument', + ], 'builtinFunctioninvalidArgumentWithWeakTypes' => [ 'code' => '