Improve ConstantArrayType::unsetOffset#1537
Conversation
2b02425 to
7af6056
Compare
|
namespace failures from my side
has been fixed by Ondrej in the tagged unions preparations
also been fixed by Ondrej |
|
irrelevant, since it has been fixed by Ondrej as mentioned in the previous comment. But I extracted a test case based on that and put it here just to be sure. |
1a7cf21 to
eda95ea
Compare
There was a problem hiding this comment.
This was array<'a'|'b'|'c'|'d', bool|int<-1, 1>|numeric-string> before. See https://phpstan.org/r/6c90923e-abf5-492d-8bf6-c5f95a6627e6
I added it because something very similar to this was failing in prestashop while developing. It has been unblocked/fixed by Ondrej's recent changes (IIRC there was a non-empty-array intersection before), but I want to avoid it failing again. And it is a nice example I think.
The union with an empty array could be optimised away. If this isn't already done in the tagged unions branch anyway.. :)
There was a problem hiding this comment.
the extracted case is basically https://phpstan.org/r/4ca3ec8a-9f81-4b87-a321-c62a7e58b768
this should be fine IMO, phpstan got a tiny bit smarter here.
9ef1528 to
a31a0f1
Compare
a31a0f1 to
41637f4
Compare
|
this is now ready. has been unblocked by recent changes basically. |
|
Really nice, thank you :) |
Basically adds support for union offsets.
Previously it generalized too early to a generic array IMO.