Browse Source

[cs] Force anything typed as Int to be cast to Int, to avoid Int64's escaping when -D erase_generics is on

Cauê Waneck 10 years ago
parent
commit
be219183a2
1 changed files with 5 additions and 0 deletions
  1. 5 0
      std/sys/db/Manager.hx

+ 5 - 0
std/sys/db/Manager.hx

@@ -362,6 +362,11 @@ class Manager<T : Object> {
 						val = haxe.io.Bytes.ofString(val);
 					case DString(_) | DTinyText | DSmallText | DText if(!Std.is(val,String)):
 						val = val + "";
+#if (cs && erase_generics)
+					// on C#, SQLite Ints are returned as Int64
+					case DInt if (!Std.is(val,Int)):
+						val = cast(val,Int);
+#end
 					case DBool if (!Std.is(val,Bool)):
 						if (Std.is(val,Int))
 							val = val != 0;