1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00
This commit is contained in:
Daniil Gentili 2022-11-21 19:18:14 +01:00
parent 5797945f97
commit 7683a48de3
2 changed files with 2 additions and 6 deletions

View File

@ -322,7 +322,7 @@ class TKeyedArray extends Atomic
$value_type = $value_type->setPossiblyUndefined(false);
if ($has_defined_keys) {
if ($has_defined_keys || $this->fallback_params !== null) {
$array_type = new TNonEmptyArray([$key_type, $value_type]);
} else {
$array_type = new TArray([$key_type, $value_type]);

View File

@ -1586,11 +1586,7 @@ class ConditionalTest extends TestCase
echo $a;
}'
],
// It is technically non-empty, but creating
// array{a: int}|array{b: int} will produce:
// array{a?: int, b?: int}, which is technically correct.
// Unmark as skipped when (if) support for unions of shapes is added.
'SKIPPED-nonEmptyArrayAfterIsset' => [
'nonEmptyArrayAfterIsset' => [
'code' => '<?php
/**
* @param array<string, int> $arr