Explorar el Código

add reinterpret type check

ncannasse hace 7 años
padre
commit
af4973c92e
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  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;
 	}