Open agoose77 opened 1 year ago
Currently, this isn't too visible; we end up introducing unions that simplify away after parameters are merged. But, this involves multiple unnecessary allocations and kernel calls.
It sounds like that means this is a (potential/unmeasured) performance issue, rather than a bug, right? If I understand what you're saying, the outputs are what they ought to be, given the inputs.
Description of new feature
TL;DR — if an indexed type has type parameters, then we can't just push mergeable checks to the content.
There is some ambiguity here, but I think this is incorrect. We only allow non-union merging when arrays have the same nominal type, so even if
IndexedArray.content
shares the same value of__array__
asother
, the externally visible types don't agree.Currently, this isn't too visible; we end up introducing unions that simplify away after parameters are merged. But, this involves multiple unnecessary allocations and kernel calls.