When compile-path is not set to a String but to a java.io.File (that's what boot-clj does at the moment). You get a Cast exception in the compiler when trying to use it from the boot repl. Common wisdom seems to be to not compile from the repl, people say don't use gen-class. I find this unfortunate for when you do want to use gen-class and iterate quickly.
I haven't tested all older versions for this issue, but git blame shows that the code that should help here wasn't changed for 10 years:
My workaround now is:
I suggest to put the type check in the 'clojure.core/compile function.