فهرست منبع

add reinterpret type check

ncannasse 7 سال پیش
والد
کامیت
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;
 	}