瀏覽代碼

[hl] fixed Type.getClass with interface/virtual input

Nicolas Cannasse 8 年之前
父節點
當前提交
c8101da167
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      std/hl/_std/Type.hx

+ 4 - 0
std/hl/_std/Type.hx

@@ -75,6 +75,10 @@ class Type {
 
 	public static function getClass<T>( o : T ) : Class<T> {
 		var t = hl.Type.getDynamic(o);
+		if( t.kind == HVirtual ) {
+			o = hl.Api.getVirtualValue(o);
+			t = hl.Type.getDynamic(o);
+		}
 		if( t.kind == HObj )
 			return t.getGlobal();
 		return null;