@@ -420,10 +420,10 @@ private function resolveIdentifierTypeNode(IdentifierTypeNode $typeNode, NameSco
420
420
return new NonAcceptingNeverType ();
421
421
422
422
case 'list ' :
423
- return TypeCombinator::intersect (new ArrayType (new IntegerType ( ), new MixedType ()), new AccessoryArrayListType ());
423
+ return TypeCombinator::intersect (new ArrayType (IntegerRangeType:: createAllGreaterThanOrEqualTo ( 0 ), new MixedType ()), new AccessoryArrayListType ());
424
424
case 'non-empty-list ' :
425
425
return TypeCombinator::intersect (
426
- new ArrayType (new IntegerType ( ), new MixedType ()),
426
+ new ArrayType (IntegerRangeType:: createAllGreaterThanOrEqualTo ( 0 ), new MixedType ()),
427
427
new NonEmptyArrayType (),
428
428
new AccessoryArrayListType (),
429
429
);
@@ -666,7 +666,7 @@ static function (string $variance): TemplateTypeVariance {
666
666
return $ arrayType ;
667
667
} elseif (in_array ($ mainTypeName , ['list ' , 'non-empty-list ' ], true )) {
668
668
if (count ($ genericTypes ) === 1 ) { // list<ValueType>
669
- $ listType = TypeCombinator::intersect (new ArrayType (new IntegerType ( ), $ genericTypes [0 ]), new AccessoryArrayListType ());
669
+ $ listType = TypeCombinator::intersect (new ArrayType (IntegerRangeType:: createAllGreaterThanOrEqualTo ( 0 ), $ genericTypes [0 ]), new AccessoryArrayListType ());
670
670
if ($ mainTypeName === 'non-empty-list ' ) {
671
671
return TypeCombinator::intersect ($ listType , new NonEmptyArrayType ());
672
672
}
0 commit comments