graalvm 2022-06-16

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 work

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

and then it will warn you about the reflective .substring usage

but you can just use subs there as well btw