ソースを参照

[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;