1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 22:01:48 +01:00

Workaround arm64 opcache bug (fixes #9350)

This commit is contained in:
Daniil Gentili 2023-02-20 12:49:59 +01:00
parent 589fee7b22
commit 88a3d288de

View File

@ -2,6 +2,7 @@
namespace Psalm\Internal\Analyzer\Statements\Expression\BinaryOp; namespace Psalm\Internal\Analyzer\Statements\Expression\BinaryOp;
use AssertionError;
use PhpParser; use PhpParser;
use Psalm\CodeLocation; use Psalm\CodeLocation;
use Psalm\Config; use Psalm\Config;
@ -41,7 +42,6 @@ use Psalm\Type\Atomic\TTemplateParam;
use Psalm\Type\Union; use Psalm\Type\Union;
use UnexpectedValueException; use UnexpectedValueException;
use function assert;
use function count; use function count;
use function reset; use function reset;
use function strlen; use function strlen;
@ -178,8 +178,12 @@ class ConcatAnalyzer
} }
if ($literal_concat) { if ($literal_concat) {
assert(count($result_type_parts) === $combinations); if (count($result_type_parts) === 0) {
assert(count($result_type_parts) !== 0); // #8163 throw new AssertionError("The number of parts cannot be 0!");
}
if (count($result_type_parts) !== $combinations) {
throw new AssertionError("The number of parts does not match!");
}
$result_type = new Union($result_type_parts); $result_type = new Union($result_type_parts);
} }
} }