diff --git a/src/Type/TypeCombinator.php b/src/Type/TypeCombinator.php index 16dfd3f5c6..0ecbf62ad3 100644 --- a/src/Type/TypeCombinator.php +++ b/src/Type/TypeCombinator.php @@ -814,13 +814,13 @@ private static function processArrayTypes(array $arrayTypes): array foreach ($constantArrays as $constantArray) { $valueTypes = $constantArray->getValueTypes(); foreach ($constantArray->getKeyTypes() as $i => $keyType) { - $keyTypesForGeneralArray[] = $keyType; $valueTypesForGeneralArray[] = $valueTypes[$i]; $keyTypeValue = $keyType->getValue(); if (array_key_exists($keyTypeValue, $constantKeyTypesNumbered)) { continue; } + $keyTypesForGeneralArray[] = $keyType; $constantKeyTypesNumbered[$keyTypeValue] = $nextConstantKeyTypeIndex; $nextConstantKeyTypeIndex *= 2;