dispatching on the eltype of a container isn't good practice, because valid containers like Any[Interval(1,2)] won't get hit (and vcat doesn't help).
if, like in my case, you don't have valid intervals, you should get an error, not a stackoverflow
This is extra annoying on MacOS because of the longstanding Julia issue where stackoverflows don't error properly on MacOS.
The easiest fix for the stackoverflow would be to remove the first method, however that would break any code that relies on find_intersections doing this collecting for them. I think a fix that preserves this behavior could look like:
It is very easy to cause a stackoverflow from:
https://github.com/invenia/Intervals.jl/blob/a785b56ce5e0091928fbb152bd2aa4834ada00d4/src/interval_sets.jl#L480
In my case I had TimeSpans because I forgot to convert them to intervals first.
I believe the intention of this code is to
collect
any iterators so we get vectors to hit the next method, https://github.com/invenia/Intervals.jl/blob/a785b56ce5e0091928fbb152bd2aa4834ada00d4/src/interval_sets.jl#L481. (I'm not sure why 1-argvcat
would be used over collect but I don't think that's the problem here).However:
Any[Interval(1,2)]
won't get hit (andvcat
doesn't help).This is extra annoying on MacOS because of the longstanding Julia issue where stackoverflows don't error properly on MacOS.
The easiest fix for the stackoverflow would be to remove the first method, however that would break any code that relies on
find_intersections
doing this collecting for them. I think a fix that preserves this behavior could look like:and then defining
with what is currently in the method at https://github.com/invenia/Intervals.jl/blob/a785b56ce5e0091928fbb152bd2aa4834ada00d4/src/interval_sets.jl#L481.