julia
c1f41ad1 - improve inferrability of tuple slicing (#39074)

Commit
5 years ago
improve inferrability of tuple slicing (#39074) * RFC: improve inferrability of tuple slicing This makes slicing tuples type stable in a lot more cases. This now only calls `ntuple` if the resulting tuple has no more than 10 elements, as just relying on the fallback in `ntuple` did have some compile-time overhead in my artificial benchmarks. I also widened the signature to `AbstractUnitRange`, since I don't see why we shouldn't have this for ranges like `OneTo` as well. * add check for offset ranges and more tests * add guard if OffsetArrays is already imported Co-authored-by: Matt Bauman <mbauman@juliacomputing.com> * import OffsetArrays correctly Co-authored-by: Matt Bauman <mbauman@juliacomputing.com>
Author
Parents
Loading