2
0
Эх сурвалжийг харах

add reinterpret type check

ncannasse 7 жил өмнө
parent
commit
af4973c92e
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  1. 4 1
      hxd/res/Loader.hx

+ 4 - 1
hxd/res/Loader.hx

@@ -37,7 +37,10 @@ class Loader {
 			res = Type.createInstance(c, [entry]);
 			currentInstance = old;
 			cache.set(path, res);
-		}
+		} else {
+			if( Std.instance(res,c) == null )
+				throw path+" has been reintrepreted from "+Type.getClass(res)+" to "+c;
+		}			
 		return res;
 	}