更新时间:2023-09-12 17:37:04
首先,应为Type.resolveClass
提供类的完全限定名称. IE. pack.subpack.AClass
.
Firstly, you should give Type.resolveClass
the fully qualified name of the class. I.e. pack.subpack.AClass
.
第二,您可以使用--macro include("pack")
. include
函数是 haxe.macro.Compiler
中的方法. --macro
默认情况下会在该类中查找方法.
Secondly, you may use --macro include("pack")
. Which the include
function is a method from haxe.macro.Compiler
. --macro
by default looks into that class for methods.
最后,haxe中的import my.package.*
语句是惰性的.它告诉编译器解析my.package
中的类型,但一开始并没有真正将所有内容导入my.package
中.
Lastly, the import my.package.*
statement in haxe is lazy. It tell the compiler to resolve types in my.package
, but not really import everything in my.package
in the beginning.