Welcome! Please see the About page for a little more info on how this works.

0 votes
in Java Interop by
The following discards the imported annotations:


(ns com.example.BaseXModuleTest
  (:import (org.basex.query QueryModule QueryModule$Deterministic))
  (:gen-class
     :extends org.basex.query.QueryModule
     :methods [
       [^{QueryModule$Deterministic {}}
        addOne [int] int]]))


However, when moving the {{gen-class}} call out of the {{ns}} declaration, the annotation is correctly applied:


(ns com.example.BaseXModuleTest
  (:import (org.basex.query QueryModule QueryModule$Deterministic)))

(gen-class
  :extends org.basex.query.QueryModule
  :name com.example.BaseXModuleTest
  :methods [
    [^{QueryModule$Deterministic {}}
     addOne [int] int]])


It appears that imported names are not yet in-scope when gen-class is run from a {{ns}} declaration.

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-968 (reported by charles-dyfis-net)
...