Skip to content

Commit 102b53b

Browse files
Review
1 parent 70f4d02 commit 102b53b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Type/Constant/ConstantArrayType.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,12 @@ public function acceptsWithReason(Type $type, bool $strictTypes): AcceptsResult
307307
return AcceptsResult::createNo();
308308
}
309309

310-
$result = AcceptsResult::createYes();
310+
if ($this->isList()->yes() && $type->isList()->maybe()) {
311+
$result = AcceptsResult::createMaybe();
312+
} else {
313+
$result = AcceptsResult::createYes();
314+
}
315+
311316
foreach ($this->keyTypes as $i => $keyType) {
312317
$valueType = $this->valueTypes[$i];
313318
$hasOffsetValueType = $type->hasOffsetValueType($keyType);

0 commit comments

Comments
 (0)