1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-03 18:17:55 +01:00
This commit is contained in:
Daniil Gentili 2022-11-26 18:21:36 +01:00
parent a342a26f0d
commit 99bdc2faeb
2 changed files with 6 additions and 6 deletions

View File

@ -733,11 +733,11 @@ class SimpleAssertionReconciler extends Reconciler
// Impossible
$existing_var_type->removeType('array');
$redundant = false;
} elseif ($assertion->count === $prop_min_count) {
// Redundant
$redundant = true;
} elseif ($array_atomic_type->fallback_params === null) {
if ($assertion->count > $prop_max_count) {
if ($assertion->count === $prop_min_count) {
// Redundant
$redundant = true;
} elseif ($assertion->count > $prop_max_count) {
// Impossible
$existing_var_type->removeType('array');
$redundant = false;

View File

@ -463,7 +463,7 @@ abstract class Type
return new TKeyedArray(
[$of->setPossiblyUndefined(true)],
null,
[self::getInt(), $of],
[new Union([new TIntRange(0, null)]), $of],
true,
$from_docblock
);
@ -477,7 +477,7 @@ abstract class Type
return new TKeyedArray(
[$of->setPossiblyUndefined(false)],
null,
[self::getInt(), $of],
[new Union([new TIntRange(0, null)]), $of],
true,
$from_docblock
);