Skip to content

Commit 9e6f914

Browse files
committed
Fix
1 parent de93b04 commit 9e6f914

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Type/ArrayType.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ class ArrayType implements Type
5252
/** @api */
5353
public function __construct(Type $keyType, private Type $itemType)
5454
{
55-
if (in_array($keyType->describe(VerbosityLevel::value()), ['(int|string)', '(int|non-decimal-int-string)'], true)) {
55+
$desc = $keyType->describe(VerbosityLevel::value());
56+
if (in_array($desc, ['(int|string)', '(int|non-decimal-int-string)'], true)) {
5657
$keyType = new MixedType();
5758
}
5859
if ($keyType instanceof StrictMixedType && !$keyType instanceof TemplateStrictMixedType) {
@@ -120,7 +121,7 @@ public function isSuperTypeOf(Type $type): IsSuperTypeOfResult
120121
{
121122
if ($type instanceof self || $type instanceof ConstantArrayType) {
122123
return $this->getItemType()->isSuperTypeOf($type->getItemType())
123-
->and($this->getIterableKeyType()->isSuperTypeOf($type->getIterableKeyType()));
124+
->and($this->getKeyType()->isSuperTypeOf($type->getKeyType()));
124125
}
125126

126127
if ($type instanceof CompoundType) {

0 commit comments

Comments
 (0)