Skip to content

Fix offset existence check on ArrayAccess intersections#363

Closed
b1rdex wants to merge 1 commit intophpstan:masterfrom
b1rdex:bug-3836
Closed

Fix offset existence check on ArrayAccess intersections#363
b1rdex wants to merge 1 commit intophpstan:masterfrom
b1rdex:bug-3836

Conversation

@b1rdex
Copy link
Copy Markdown
Contributor

@b1rdex b1rdex commented Oct 28, 2020

Closes phpstan/phpstan#3836

I'm not sure whether it's a correct way or not...

Closes phpstan/phpstan#3836

I'm not sure whether it's a correct way or not...
@ondrejmirtes
Copy link
Copy Markdown
Member

Nope, this is the wrong solution. The right solution is to modify ObjectType and have hasOffsetValueType return at least maybe: if it's representing an interface or a non-final class.

@ondrejmirtes
Copy link
Copy Markdown
Member

Best way is to modify ObjectType::isExtraOffsetAccessibleClass().

@ondrejmirtes
Copy link
Copy Markdown
Member

Done: b55656f

Thanks for the test :)

@b1rdex b1rdex deleted the bug-3836 branch October 29, 2020 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArrayAccess intersection type "Offset doesn't exist" false positive

2 participants