For context, the actual function is Base.show_delim_array and I’m trying to override it in the case that l=last(LinearIndices(itr)) is of type Infinity from InfiniteArrays.jl. This seems like the easiest way of preventing show(stdout, 1:∞) from printing forever. Of course, I can override this for special array types, but this has limitations for “composed arrays” like view(1:∞, 3:∞).
I know this is a “bad” idea, but I view it as a temporary work around until I can make a PR to Base to give me the right overloading abilities.
I don’t think you can dispatch on keyword argument types.
I’ve also encountered this issue with the keyword argument frenzy that happened in 0.7. Previously I could just overload a function by specifying the argument type but then it got moved to a keyword and it is no longer possible.
Right, it only works if there’s a generic “catchall” version of the function that grabs up the keyword arguments and then calls some inner function with kw.data.