reconcile two arrays by intersecting them#7470
reconcile two arrays by intersecting them#7470orklah merged 1 commit intovimeo:masterfrom orklah:array_is_list2
Conversation
If you're referring to combining I know we haven't decided how to handle sealed arrays yet, but I've recently thought about implementing mapped types for arrays, so an unsealed array in Psalm 4 would be represented as |
|
I think the syntax will need to be discussed with Ondrej, we don't want to create two standard on something this important I think |
|
I'll go comment on 5299, do we have somewhere else we're already coordinating with Ondrej or should I ping him? Edit: Actually I see he already mentioned it here |
This should fix #7469
This happened because there wasn't a dedicated code to handle an array existing type along with an array assertion
And given the two share the same getKey() value, it was weirdly handled.
This adds some specific code.
Not completely related to this PR: sometimes, we'll have to wonder what does TypeCombiner::combine really does. It's not the result of an union nor a result of an intersection. It kinda looks like the
refineTypeWithAnotherused somewhere else in the assertion module. I think the name is way better thancombineand the way it works seems to be better too