Skip to content

Commit

Permalink
fix: callable and iterable are maybe not isOffsetAccessLegal
Browse files Browse the repository at this point in the history
  • Loading branch information
rajyan committed May 7, 2024
1 parent dbfc3b8 commit 4b4af8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Type/CallableType.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public function toArrayKey(): Type

public function isOffsetAccessLegal(): TrinaryLogic
{
return TrinaryLogic::createYes();
return TrinaryLogic::createMaybe();
}

public function getTemplateTypeMap(): TemplateTypeMap
Expand Down
2 changes: 1 addition & 1 deletion src/Type/IterableType.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function toArrayKey(): Type

public function isOffsetAccessLegal(): TrinaryLogic
{
return TrinaryLogic::createYes();
return TrinaryLogic::createMaybe();
}

public function isIterable(): TrinaryLogic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,10 @@ public function testBug8068(): void
"Cannot access offset 'path' on Closure.",
18,
],
[
"Cannot access offset 'path' on iterable<int|string, object>.",
26,
],
]);
}

Expand Down

0 comments on commit 4b4af8e

Please sign in to comment.