Google Guava 30.1 defines these two addAll overloads for TreeRangeSet:
public void TreeRangeSet.addAll(RangeSet)
public default void RangeSet.addAll(Iterable<Range>)
The following compiles without error or warning:
(import [com.google.common.collect Range RangeSet TreeRangeSet])
(defn example []
(let [container (TreeRangeSet/create)
temp (TreeRangeSet/create ^Iterable (list (Range/closed 1 2)))]
(.addAll container ^RangeSet temp)))
However, calling example fails with a runtime error stating that TreeRangeSet does not implement Iterable. As I understand it, this error happens because the Clojure compiler has emitted a call to the second overload (despite the type hint). After some experimenting, I believe this happens because the first overload returns true for isBridge; Reflector.getMethods will not return it since the second overload is not a bridge method.
So two questions: is there a way to generate a call to the first overload, and, if not, should there be?
(By the way, in initializing temp above, I wanted to use:
(let [temp (TreeRangeSet/create ^Iterable [(Range/closed 1 2)])
but this generates a reflection warning. I belive it is an example of CLJ-1929.)