Kaynağa Gözat

[java] unit tests fixes

Caue Waneck 12 yıl önce
ebeveyn
işleme
67d81257da
2 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  1. 1 1
      gencommon.ml
  2. 3 0
      std/haxe/ds/Vector.hx

+ 1 - 1
gencommon.ml

@@ -8013,7 +8013,7 @@ struct
             let cf = mk_class_field name actual_t true pos (Var { v_read = AccNormal; v_write = AccNormal }) [] in
             cf.cf_meta <- [];
             cf.cf_expr <- Some {
-              eexpr = TNew(cl, List.map (fun _ -> t_empty) cl.cl_types, [mk_int gen old_i pos; null (basic.tarray t_empty) pos]);
+              eexpr = TNew(cl, List.map (fun _ -> t_empty) cl.cl_types, [mk_int gen old_i pos; { eexpr = TArrayDecl []; etype = basic.tarray t_empty; epos = pos }]);
               etype = TInst(cl, List.map (fun _ -> t_empty) cl.cl_types);
               epos = pos;
             };

+ 3 - 0
std/haxe/ds/Vector.hx

@@ -57,6 +57,9 @@ abstract Vector<T>(VectorData<T>) {
 			this = [];
 			#if cpp
 				untyped this.__SetSize(length);
+			#elseif (java || cs)
+				//TODO optimize
+				this[length-1] = cast null;
 			#else
 				untyped this.length = length;
 			#end