Skip to content

Commit

Permalink
Workaround arm64 opcache bug (fixes vimeo#9350)
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Feb 20, 2023
1 parent d37cf10 commit 7320753
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Psalm\Internal\Analyzer\Statements\Expression\BinaryOp;

use AssertionError;
use PhpParser;
use Psalm\CodeLocation;
use Psalm\Config;
Expand Down Expand Up @@ -41,7 +42,6 @@
use Psalm\Type\Union;
use UnexpectedValueException;

use function assert;
use function count;
use function reset;
use function strlen;
Expand Down Expand Up @@ -178,8 +178,12 @@ public static function analyze(
}

if ($literal_concat) {
assert(count($result_type_parts) === $combinations);
assert(count($result_type_parts) !== 0); // #8163
if (count($result_type_parts) === 0) {
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);
}
}
Expand Down

0 comments on commit 7320753

Please sign in to comment.