【发布时间】:2017-04-04 15:28:25
【问题描述】:
是否可以在haxe中获取具有空值的字段类?
“Type.getClass”函数获取值类(在运行时设置),但我需要在编译时获取类。
函数“getClassFields”只返回字段名,不返回类。
例如:
class MyCls
{
public static var i:Int = null;
public static var s:String = null;
}
trace(Type.getClass(MyCls.i)); // show "null", but I need to get Int
trace(Type.getClass(MyCls.s)); // show "null", but I need to get String
在我的情况下,我无法更改 MyCls 类的来源。
谢谢。
【问题讨论】:
标签: class types metaprogramming haxe neko