Skip to content

Commit

Permalink
Merge pull request #9351 from Nicelocal/fix_9350
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Feb 20, 2023
2 parents 589fee7 + 484043a commit 9e0dd5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -84,10 +84,10 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
ini-values: zend.assertions=1, assert.exception=1
ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
tools: composer:v2
coverage: none
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, opcache, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter

- uses: actions/checkout@v3

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-ci.yml
Expand Up @@ -55,10 +55,10 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
ini-values: zend.assertions=1, assert.exception=1
ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
tools: composer:v2
coverage: none
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, opcache, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter

- uses: actions/checkout@v3

Expand Down
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 9e0dd5a

Please sign in to comment.