以下内容丢弃了导入的注解
(ns com.example.BaseXModuleTest
(:import (org.basex.query QueryModule QueryModule$Deterministic))
(:gen-class
:extends org.basex.query.QueryModule
:methods [
[^{QueryModule$Deterministic {}}
addOne [int] int]]))
然而,当将gen-class调用从ns声明中移除时,注解会被正确应用
(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]])
看起来在从ns声明中运行gen-class时,导入的名称尚未在作用域内。