Uploaded image for project: 'Clojure'
  1. CLJ-968

ns emitting gen-class before imports results in imported annotations being discarded.

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: Release 1.4, Release 1.3
    • Fix versions: None
    • Labels:

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              charles-dyfis-net Charles Duffy
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: