Browse Source

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

Nicolas Cannasse 8 years ago
parent
commit
c8101da167
1 changed files with 4 additions and 0 deletions
  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;