是否可以在 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 类的来源。
谢谢。