Can't make Dart->Clojure translator work with graalvm, need help 🙏. Seems like I have problems with reflection:
╰$ ./dartclj "Text('1')"
Exception in thread "main" java.lang.IllegalArgumentException: No matching method substring
found taking 2 args for class java.lang.String
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:127)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:102)
Here is a https://github.com/Liverm0r/DartClojure/blob/main/compile.sh file. I pass a flag -H:ReflectionConfigurationFiles with json, where I ask to remain allMethods, constructors, etc. But it doesn't work.graalvm -v 22.1, java 11
I have also found this @borkdude https://github.com/borkdude/clj-reflector-graal-java11-fix and tryied to add
{
"name": "java.lang.reflect.AccessibleObject",
"methods" : [{"name":"canAccess"}]
},
— didn't workRead this: https://github.com/clj-easy/graal-docs#reflection
Just add the String class in your reflection config file
or get rid off your reflection using type hints in Clojure which is even better
Put #?(:clj (set! *warn-on-reflection* true)) in the top of this file:
https://github.com/Liverm0r/DartClojure/blob/7e1a72e2e046725084439be9eb812903f300c042/src/dumch/parse.cljc#L372
and then it will warn you about the reflective .substring usage
but you can just use subs there as well btw
Thank you!