mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
parent
05ace25817
commit
94636476d2
@ -48,7 +48,6 @@ use function preg_match;
|
||||
use function preg_quote;
|
||||
use function strtolower;
|
||||
use function strlen;
|
||||
use DeepCopy\TypeMatcher\TypeMatcher;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@ -450,7 +449,7 @@ class BinaryOpAnalyzer
|
||||
$naive_type = $stmt->left->inferredType ?? null;
|
||||
|
||||
if ($naive_type
|
||||
&& !$naive_type->isMixed()
|
||||
&& !$naive_type->hasMixed()
|
||||
&& !$naive_type->isNullable()
|
||||
) {
|
||||
$var_id = ExpressionAnalyzer::getVarId($stmt->left, $context->self);
|
||||
|
@ -1497,6 +1497,16 @@ class TypeReconciliationTest extends TestCase
|
||||
return $a;
|
||||
}'
|
||||
],
|
||||
'nullCoalescePossibleMixed' => [
|
||||
'<?php
|
||||
/**
|
||||
* @psalm-suppress MixedReturnStatement
|
||||
* @psalm-suppress MixedInferredReturnType
|
||||
*/
|
||||
function foo() : array {
|
||||
return filter_input_array(INPUT_POST) ?? [];
|
||||
}',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user