Currently gen-class only works while AOT compiling, but just evaluates to nil while JIT loading.
The reason for this behaviour is historical and no longer relvant since landed in 1.7, which fixed the dynamic classloader definition issues and also made this exact same change for gen-interface. The only reason why this wasn't also done for gen-class is that I forgot about it.
This patch fixes this inconsistency
Patch: 0001-CLJ-2343-define-and-load-class-while-JITing-gen-clas.patch
Comment made by: kari
Just asking if the issue I asked in Clojure Slack relates to this JIRA issue.
If I have a gen-class (e.g. mygenclass) as part of my Clojure project and I want to refresh all namespaces in Clojure REPL using command:
(do (require '[clojure.tools.namespace.repl :refer [refresh]]) (refresh))
... then I get an error: "namespace 'mygenclass' not found after loading 'mygenclass'.
Now that there is Deps and CLI, this change would make it even more easier package a library using that uses gen-class, since no class files would need to be packaged (if I understood correctly).
Just a friendly nudge, is the anything that could be helped with this change?