Welcome! Please see the About page for a little more info on how this works.

0 votes
in core.rrb-vector by

I tried to test boot on JDK 11 EA builds and there seems to be fipp somewhere in the dependency chain that has core.rrb-vector 0.0.11 as dependency. It fails with the below error :

 java.lang.IllegalArgumentException: Must hint overloaded method: toArray

clojure.lang.Compiler$CompilerException: java.lang.IllegalArgumentException: Must hint overloaded method: toArray, compiling:(clojure/core/rrb_vector/rrbt.clj:282:1)

         clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: Must hint overloaded method: toArray, compiling:(clojure/core/rrb_vector/rrbt.clj:282:1)

Reference Travis build : https://travis-ci.org/tirkarthi/boot/jobs/398611988#L803

This was passing a few days back but fails as of now. Feel free to close this if it's fixed in master and it's not released yet.

Successful build : https://travis-ci.org/tirkarthi/boot/jobs/398610834

9 Answers

0 votes
by

Comment made by: wcohen

This patch adds type hints on the (link: this arr) arity of toArray, which leads to a successful compile and test on JDK 11 EA 21. Also works on JDK 8 and 10.

0 votes
by

Comment made by: michalmarczyk

Thanks! Applied and pushed. Will cut a release soon.

0 votes
by

Comment made by: wcohen

Thanks! Also, I only signed/submitted the Clojure CA this morning. Let me know if there's anyone else I need to follow up with there.

0 votes
by
_Comment made by: jafingerhut_

For future reference, in case anyone besides me is curious, this error did not occur with JDK 10 and earlier, because the only 1-parameter method named "toArray" in interface java.util.Collection was this one: https://download.java.net/java/early_access/jdk11/docs/api/java.base/java/util/Collection.html#toArray(T%5B%5D) with signature "<T> T[] toArray​(T[] a)"

Starting with JDK 11, another 1-parameter method named "toArray" was added to interface java.util.Collection: https://download.java.net/java/early_access/jdk11/docs/api/java.base/java/util/Collection.html#toArray(java.util.function.IntFunction) with signature "default <T> T[] toArray​(IntFunction<T[]> generator)"

Thus without the type hint, the Clojure compiler had no way to determine which method was intended in a deftype form that tried to define toArray with 1 parameter ('this' plus 1 more parameter in the Clojure deftype method definition).
0 votes
by

Comment made by: xtreak

Thanks @jafingerhut for the information. Relevant commit : http://hg.openjdk.java.net/jdk/jdk11/rev/3ef0862bbb3d . It also seems to cause issues with Clojure's master branch and the patch by Will Cohen helps tests to pass. I have opened a related issue there : https://dev.clojure.org/jira/browse/CLJ-2374

0 votes
by

Comment made by: kanwei

Any chance there could be a new release of rrb-vector? JDK 11 is now in RC and it seems the issue has been fixed on master. Thanks!

0 votes
by

Comment made by: gshayban

This is in the latest release, I think this ticket can be closed.

0 votes
by

Comment made by: desk@danielcompton.net

This was merged in https://github.com/clojure/core.rrb-vector/commit/b489b3249d56bb6a104c2d4ead2da8ade8dd29b4 and is available in version 0.0.12 and later (0.0.13 is the latest version at the time of writing). For easy copy/pasting:

[org.clojure/core.rrb-vector "0.0.13"]

0 votes
by
Reference: https://clojure.atlassian.net/browse/CRRBV-18 (reported by xtreak)
...