(Java 11) Using <gnu.kawa.functions.NamedPart> in type declaration causes java.lang.IllegalAccessError on subsequent usages of the variable
Behavior is related to java version. Using java 8 the error is not thrown.
Java 8 runtime:
(define x :: <gnu.kawa.functions.NamedPart> (java.lang.String):format)
x
;; #<procedure gnu.kawa.functions.NamedPart>
Java 11 runtime:
(define x :: <gnu.kawa.functions.NamedPart> (java.lang.String):format)
x
;; Exception in thread "main" java.lang.IllegalAccessError: failed to access class gnu.kawa.functions.NamedPart from class atInteractiveLevel-2 (gnu.kawa.functions.NamedPart is in unnamed module of loader 'app'; atInteractiveLevel-2 is in unnamed module of loader gnu.bytecode.ArrayClassLoader @36bc55de)
;; at atInteractiveLevel-2.run(tty:2)
;; at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290)
;; at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
;; at kawa.Shell.run(Shell.java:289)
;; at kawa.Shell.run(Shell.java:196)
;; at kawa.Shell.run(Shell.java:183)
;; at kawa.repl.processArgs(repl.java:724)
;; at kawa.repl.main(repl.java:830)
Things work fine even in java 11 if you omit the type declaration:
(define x (java.lang.String):format)
x
;; #<procedure gnu.kawa.functions.NamedPart>
(P.S. Sorry if I couldn't explore myself the 3 issues I just opened, but I read you are planning to do a 3.1 release and I'll have no time to play with Kawa until next year (I'm planning to write a java library for kawa to support one of {swank, geiser, nrepl, jupyter} then)).