improve nongeneric methods of Base.rest#59549
Conversation
94f21aa to
2dc15ce
Compare
2dc15ce to
278212f
Compare
Allow non-`Int` in dispatch for the second argument (iteration state), but `typeassert` `Int` in the method body. This improves abstract inference because the compiler can know the second argument must be `Int` to avoid a throw, when previously such a call would have dispatched to the generic method.
c2f7aac to
25c21c7
Compare
|
I can see how this could help inference for |
A JuliaHub search indicates that several packages implement an While, I believe that justifies this PR. Of course, I could also split the |
Sure, but it will still be inferred as |
Base.rest, Base.indexed_iterateBase.rest
|
CI is all green now. @oscardssmith Do you want to merge this? |
Allow non-
Intin dispatch for the second argument (iteration state), buttypeassertIntin the method body. This improves abstract inference because the compiler can know the second argument must beIntto avoid a throw, when previously such a call would have dispatched to the generic method.