Explorar el Código

[cs] unit-tests related fixes

Caue Waneck hace 12 años
padre
commit
ffb34803b3

+ 4 - 3
codegen.ml

@@ -1319,13 +1319,14 @@ let handle_abstract_casts ctx e =
 	let rec make_static_call c cf a pl args t p =
 		let ta = TAnon { a_fields = c.cl_statics; a_status = ref (Statics c) } in
 		let ethis = mk (TTypeExpr (TClassDecl c)) ta p in
+		let map t = apply_params a.a_types pl (monomorphs cf.cf_params t) in
 		let def () =
-			let e = mk (TField (ethis,(FStatic (c,cf)))) cf.cf_type p in
-			mk (TCall(e,args)) t p
+			let e = mk (TField (ethis,(FStatic (c,cf)))) (map cf.cf_type) p in
+			mk (TCall(e,args)) (map t) p
 		in
 		let e = match cf.cf_expr with
 		| Some { eexpr = TFunction fd } when cf.cf_kind = Method MethInline ->
-			let config = if Meta.has Meta.Impl cf.cf_meta then (Some (a.a_types <> [] || cf.cf_params <> [], fun t -> apply_params a.a_types pl (monomorphs cf.cf_params t))) else None in
+			let config = if Meta.has Meta.Impl cf.cf_meta then (Some (a.a_types <> [] || cf.cf_params <> [], map)) else None in
 			(match Optimizer.type_inline ctx cf fd ethis args t config p true with
 				| Some e -> (match e.eexpr with TCast(e,None) -> e | _ -> e)
 				| None ->

+ 78 - 115
gencommon.ml

@@ -3673,120 +3673,25 @@ struct
   (* from this info, it will infer the applied tparams for the function *)
   (* this function is used by CastDetection module *)
   let infer_params gen pos (original_args:((string * bool * t) list * t)) (applied_args:((string * bool * t) list * t)) (params:(string * t) list) impossible_tparam_is_dynamic : tparams =
-    let args_list args = ( List.map (fun (_,_,t) -> if impossible_tparam_is_dynamic then gen.greal_type t else t) (fst args) ) @ (if impossible_tparam_is_dynamic then [] else [snd args]) in
-    let params_tbl = Hashtbl.create (List.length params) in
-
-    let pmap_iter2 fn orig_pmap applied_pmap =
-      PMap.iter (fun name cf ->
-        try
-          let applied_cf = PMap.find name applied_pmap in
-          fn cf applied_cf
-        with | Not_found -> () (* 'swallow' not_found expressions as there might be unsafe casts or untyped behavior here *)
-      ) orig_pmap
-    in
-
-    let rec get_arg original applied =
-      match (original, applied) with
-        | TInst( ({ cl_kind = KTypeParameter tlist } as cl ), []), _ ->
-          (match tlist, follow applied with
-            | [hd], TDynamic _
-            | [hd], TMono _ ->
-              Hashtbl.replace params_tbl cl.cl_path hd
-            | _ ->
-              Hashtbl.replace params_tbl cl.cl_path applied
-          )
-
-        | TAbstract(a, params), TAbstract(a2, params2) ->
-          if a == a2 then
-            List.iter2 (get_arg) params params2
-          else begin
-            List.iter (fun (t,_) ->
-              let t = apply_params a2.a_types params2 t in
-              get_arg original t
-            ) a2.a_to;
-            List.iter (fun (t,_) ->
-              let t = apply_params a.a_types params t in
-              get_arg t applied
-            ) a.a_from
-          end
-
-        | TInst(cl, params), TInst(cl2, params2) ->
-          let rec loop cl2 params2 =
-            if cl == cl2 then begin
-              List.iter2 (get_arg) params params2;
-              true
-            end else begin
-              if not (cl.cl_interface && List.exists (fun (cs,tls) ->
-                loop cs (List.map (apply_params cl2.cl_types params2) tls)
-              ) cl2.cl_implements) then
-                match cl2.cl_super with
-                  | None -> (* not related ! *) false
-                  | Some (cs,tls) ->
-                    loop cs (List.map (apply_params cl2.cl_types params2) tls)
-              else
-                true
-            end
-          in
-          ignore (loop cl2 params2)
-
-        | TAbstract(a, params), _ ->
-          List.iter (fun (t,_) ->
-            let t = apply_params a.a_types params t in
-            get_arg t applied
-          ) a.a_from
-        | _, TAbstract(a2, params2) ->
-          List.iter (fun (t,_) ->
-            let t = apply_params a2.a_types params2 t in
-            get_arg original t
-          ) a2.a_to
-
-        | TEnum(e, params), TEnum(e2, params2) ->
-          List.iter2 (get_arg) params params2
-        | TFun(params, ret), TFun(params2, ret2) ->
-          List.iter2 (get_arg) ( args_list (params, ret) ) ( args_list (params2, ret2) )
-        | TAnon (a_original), TAnon (a_applied) ->
-          pmap_iter2 (fun cf_o cf_a -> get_arg cf_o.cf_type cf_a.cf_type ) a_original.a_fields a_applied.a_fields
-        | TAnon (a_original), TInst(cl, params) ->
-          PMap.iter (fun name cf ->
-            match field_access gen applied name with
-              | FClassField (cl, params, _, cf, is_static, actual_t) ->
-                let t = apply_params cl.cl_types params actual_t in
-                get_arg cf.cf_type t
-              | FDynamicField t -> get_arg cf.cf_type (apply_params cl.cl_types params t)
-              | FNotFound -> (* the field may not be there *) ()
-              | _ -> assert false
-          ) a_original.a_fields
-        | TType(t_o, params_o), TType(t_a, params_a) when t_o == t_a ->
-          List.iter2 (get_arg) params_o params_a
-        | _, TType _
-        | _, TMono _
-        | _, TLazy _ ->
-          get_arg original (follow_once applied)
-        | TType _, _
-        | TMono _, _
-        | TLazy _, _ ->
-          get_arg (follow_once original) applied
-        | _ -> ()
-    in
+    let args_list args = TFun( List.map (fun (n,o,t) -> (n,o,if impossible_tparam_is_dynamic then gen.greal_type t else t)) (fst args), if impossible_tparam_is_dynamic then t_dynamic else snd args ) in
 
+    let monos = List.map (fun _ -> mk_mono()) params in
     let original = args_list original_args in
+
+    let original = apply_params params monos original in
     let applied = args_list applied_args in
 
-    List.iter2 (fun original applied ->
-      get_arg original applied
-    ) original applied;
+    (try
+      unify applied original
+    with | Unify_error el ->
+        gen.gcon.warning ("This expression may be invalid") pos
+    );
 
-    List.map (fun (_,t) ->
+    List.map (fun t ->
       match follow t with
-        | TInst(cl,_) when !debug_mode ->
-          (try Hashtbl.find params_tbl cl.cl_path with | Not_found ->
-            (gen.gcon.warning ("Error: function argument " ^ (snd cl.cl_path) ^ " not applied.") pos);
-            t_empty)
-        | TInst(cl,_) ->
-          (try Hashtbl.find params_tbl cl.cl_path with | Not_found -> t_empty)
-        | _ ->
-          assert false
-    ) params
+        | TMono _ -> t_empty
+        | t -> t
+    ) monos
 
   (* ******************************************* *)
   (* Real Type Parameters Module *)
@@ -4160,6 +4065,53 @@ struct
 
         cfield
 
+      let create_static_cast_cf gen iface cf =
+        let p = iface.cl_pos in
+        let basic = gen.gcon.basic in
+        let cparams = List.map (fun (s,t) -> ("To_" ^ s, TInst (map_param (get_cl_t t), []))) cf.cf_params in
+        let me_type = TInst(iface,[]) in
+        let cfield = mk_class_field "__hx_cast" (TFun(["me",false,me_type], t_dynamic)) false iface.cl_pos (Method MethNormal) (cparams) in
+        let params = List.map snd cparams in
+
+        let me = alloc_var "me" me_type in
+        let field = { eexpr = TField(mk_local me p, FInstance(iface,cf)); etype = apply_params cf.cf_params params cf.cf_type; epos = p } in
+        let call =
+        {
+          eexpr = TCall(field, []);
+          etype = t_dynamic;
+          epos = p;
+        } in
+        let call = gen.gparam_func_call call field params [] in
+
+        let delay () =
+          cfield.cf_expr <-
+          Some {
+            eexpr = TFunction(
+            {
+              tf_args = [me,None];
+              tf_type = t_dynamic;
+              tf_expr =
+              {
+                eexpr = TReturn( Some
+                {
+                  eexpr = TIf(
+                    { eexpr = TBinop(Ast.OpNotEq, mk_local me p, null me.v_type p); etype = basic.tbool; epos = p },
+                    call,
+                    Some( null me.v_type p )
+                  );
+                  etype = t_dynamic;
+                  epos = p;
+                });
+                etype = basic.tvoid;
+                epos = p;
+              }
+            });
+            etype = cfield.cf_type;
+            epos = p;
+          }
+        in
+        cfield, delay
+
       let default_implementation gen ifaces base_generic =
         let add_iface cl =
           gen.gadd_to_module (TClassDecl cl) (max_dep);
@@ -4184,6 +4136,11 @@ struct
 
               (if not cl.cl_interface then cl.cl_ordered_fields <- cast_cf :: cl.cl_ordered_fields);
               let iface_cf = mk_class_field original_name cast_cf.cf_type false cast_cf.cf_pos (Method MethNormal) cast_cf.cf_params in
+              let cast_static_cf, delay = create_static_cast_cf gen iface iface_cf in
+
+              cl.cl_ordered_statics <- cast_static_cf :: cl.cl_ordered_statics;
+              cl.cl_statics <- PMap.add cast_static_cf.cf_name cast_static_cf cl.cl_statics;
+              gen.gafter_filters_ended <- delay :: gen.gafter_filters_ended; (* do not let filters alter this expression content *)
 
               iface_cf.cf_type <- cast_cf.cf_type;
               iface.cl_fields <- PMap.add original_name iface_cf iface.cl_fields;
@@ -4207,11 +4164,12 @@ struct
 
     (* create a common interface without type parameters and only a __Cast<> function *)
     let default_implementation gen (dyn_tparam_cast:texpr->t->texpr) ifaces =
-      let change_expr e iface params =
-        let field = mk_field_access gen (mk_cast (TInst(iface,[])) e) "cast" e.epos in
-        let call = { eexpr = TCall(field, []); etype = t_dynamic; epos = e.epos } in
+      let change_expr e cl iface params =
+        let field = mk_static_field_access_infer cl "__hx_cast" e.epos params in
+        let elist = [mk_cast (TInst(iface,[])) e] in
+        let call = { eexpr = TCall(field, elist); etype = t_dynamic; epos = e.epos } in
 
-        gen.gparam_func_call call field params []
+        gen.gparam_func_call call field params elist
       in
 
       let rec run e =
@@ -4222,7 +4180,7 @@ struct
               (match t with
                 | TInst(cl, p1 :: pl) when is_hxgeneric (TClassDecl cl) ->
                   let iface = Hashtbl.find ifaces cl.cl_path in
-                  mk_cast e.etype (change_expr (Type.map_expr run cast_expr) iface (p1 :: pl))
+                  mk_cast e.etype (change_expr (Type.map_expr run cast_expr) cl iface (p1 :: pl))
                 | _ -> Type.map_expr run e
               )
             | _ -> Type.map_expr run e
@@ -4792,7 +4750,7 @@ struct
                   handle_cast gen ({ ecall with eexpr = TCall({ e1 with eexpr = TField(ef, f) }, elist )  }) (gen.greal_type ecall.etype) (gen.greal_type ret)
                 )
               | _ ->
-                let _params = TypeParams.infer_params gen ecall.epos (get_fun cf.cf_type) (get_fun e1.etype) cf.cf_params impossible_tparam_is_dynamic in
+                let _params = TypeParams.infer_params gen ecall.epos (get_fun (apply_params cl.cl_types params cf.cf_type)) (get_fun e1.etype) cf.cf_params impossible_tparam_is_dynamic in
                 let args, ret = get_args actual_t in
                 let actual_t = TFun(List.map (fun (n,o,t) -> (n,o,gen.greal_type t)) args, gen.greal_type ret) in
 
@@ -4983,8 +4941,13 @@ struct
             { e with eexpr = TNew(cl, tparams, List.map2 (fun e t -> handle (run e) t e.etype) eparams (get_f t)) }
           )
         | TArray(arr, idx) ->
+          let arr_etype = match follow arr.etype with
+          | (TInst _ as t) -> t
+          | TAbstract ({ a_impl = Some _ } as a, pl) ->
+            follow (Codegen.get_underlying_type a pl)
+          | t -> t in
           (* get underlying class (if it's a class *)
-          (match follow arr.etype with
+          (match arr_etype with
             | TInst(cl, params) ->
               (* see if it implements ArrayAccess *)
               (match cl.cl_array_access with

+ 22 - 1
gencs.ml

@@ -593,6 +593,8 @@ let configure gen =
   let rec real_type t =
     let t = gen.gfollow#run_f t in
     let ret = match t with
+      | TAbstract ({ a_impl = Some _ } as a, pl) ->
+        real_type (Codegen.get_underlying_type a pl)
       | TInst( { cl_path = (["haxe"], "Int32") }, [] ) -> gen.gcon.basic.tint
       | TInst( { cl_path = (["haxe"], "Int64") }, [] ) -> ti64
       | TAbstract( { a_path = [],"Class" }, _ )
@@ -737,6 +739,8 @@ let configure gen =
           | Statics _ | EnumStatics _ -> "System.Type"
           | _ -> "object")
       | TDynamic _ -> "object"
+      | TAbstract(a,pl) when a.a_impl <> None ->
+        t_s (Codegen.get_underlying_type a pl)
       (* No Lazy type nor Function type made. That's because function types will be at this point be converted into other types *)
       | _ -> if !strict_mode then begin trace ("[ !TypeError " ^ (Type.s_type (Type.print_context()) t) ^ " ]"); assert false end else "[ !TypeError " ^ (Type.s_type (Type.print_context()) t) ^ " ]"
 
@@ -1325,7 +1329,12 @@ let configure gen =
         print w "%s %s %s %s %s" (visibility) v_n (String.concat " " modifiers) (if is_new then "" else rett_s (run_follow gen ret_type)) (change_field name);
         let params, params_ext = get_string_params cf.cf_params in
         (* <T>(string arg1, object arg2) with T : object *)
-        print w "%s(%s)%s" (params) (String.concat ", " (List.map (fun (name, _, t) -> sprintf "%s %s" (argt_s (run_follow gen t)) (change_id name)) args)) (params_ext);
+        (match cf.cf_expr with
+        | Some { eexpr = TFunction tf } ->
+            print w "%s(%s)%s" (params) (String.concat ", " (List.map (fun (var, _) -> sprintf "%s %s" (argt_s (run_follow gen var.v_type)) (change_id var.v_name)) tf.tf_args)) (params_ext)
+        | _ ->
+            print w "%s(%s)%s" (params) (String.concat ", " (List.map (fun (name, _, t) -> sprintf "%s %s" (argt_s (run_follow gen t)) (change_id name)) args)) (params_ext)
+        );
         if is_interface then
           write w ";"
         else begin
@@ -1475,6 +1484,8 @@ let configure gen =
   in
 
   let gen_class w cl =
+    write w "#pragma warning disable 109, 114, 219, 429, 168, 162";
+    newline w;
     let should_close = match change_ns (fst (cl.cl_path)) with
       | [] -> false
       | ns ->
@@ -1692,6 +1703,8 @@ let configure gen =
     true
   );
 
+  AbstractImplementationFix.configure gen;
+
   IteratorsInterface.configure gen (fun e -> e);
 
   OverrideFix.configure gen;
@@ -1786,6 +1799,14 @@ let configure gen =
 
   (* let closure_func = ReflectionCFs.implement_closure_cl rcf_ctx ( get_cl (get_type gen (["haxe";"lang"],"Closure")) ) in *)
   let closure_cl = get_cl (get_type gen (["haxe";"lang"],"Closure")) in
+  let varargs_cl = get_cl (get_type gen (["haxe";"lang"],"VarArgsFunction")) in
+  let dynamic_name = gen.gmk_internal_name "hx" "invokeDynamic" in
+
+  List.iter (fun cl ->
+    List.iter (fun cf ->
+      if cf.cf_name = dynamic_name then cl.cl_overrides <- cf :: cl.cl_overrides
+    ) cl.cl_ordered_fields
+  ) [closure_cl; varargs_cl];
 
   let closure_func = ReflectionCFs.get_closure_func rcf_ctx closure_cl in
 

+ 1 - 1
std/cs/Boot.hx

@@ -29,7 +29,7 @@ import cs.internal.Iterator;
 import cs.internal.Null;
 import cs.internal.StringExt;
 import cs.StdTypes;
-import StringMap;
+import haxe.ds.StringMap;
 import Reflect;
 
 class Boot

+ 1 - 1
std/cs/_std/EReg.hx

@@ -21,7 +21,7 @@
  */
 import cs.system.text.regularExpressions.Regex;
 
-@:coreApi class EReg {
+class EReg {
 
 	private var regex : Regex;
 	private var m : Match;

+ 2 - 2
std/cs/_std/Reflect.hx

@@ -101,7 +101,7 @@ import cs.internal.Function;
 		if (o is haxe.lang.IHxObject)
 			return ((haxe.lang.IHxObject) o).__hx_getField(field, haxe.lang.FieldLookup.hash(field), false, false, true);
 
-		if (haxe.lang.Runtime.hasField(o, "get_" + field))
+		if (haxe.lang.Runtime.slowHasField(o, "get_" + field))
 			return haxe.lang.Runtime.slowCallField(o, "get_" + field, null);
 
 		return haxe.lang.Runtime.slowGetField(o, field, false);
@@ -117,7 +117,7 @@ import cs.internal.Function;
 	@:functionCode('
 		if (o is haxe.lang.IHxObject)
 			((haxe.lang.IHxObject) o).__hx_setField(field, haxe.lang.FieldLookup.hash(field), value, true);
-		else if (haxe.lang.Runtime.hasField(o, "set_" + field))
+		else if (haxe.lang.Runtime.slowHasField(o, "set_" + field))
 			haxe.lang.Runtime.slowCallField(o, "set_" + field, new Array<object>(new object[]{value}));
 		else
 			haxe.lang.Runtime.slowSetField(o, field, value);

+ 2 - 2
std/cs/_std/Type.hx

@@ -162,7 +162,7 @@ import cs.internal.Runtime;
 	@:functionCode('
 		if (name == "Bool") return typeof(bool);
 		System.Type t = resolveClass(name);
-		if (t != null && (t.BaseType.Equals(typeof(System.Enum)) || t.BaseType.Equals(haxe.lang.Enum)))
+		if (t != null && (t.BaseType.Equals(typeof(System.Enum)) || t.BaseType.Equals(typeof(haxe.lang.Enum))))
 			return t;
 		return null;
 	')
@@ -187,7 +187,7 @@ import cs.internal.Runtime;
 	}
 
 	@:functionCode('
-		if (@params == null || @params.length == 0)
+		if (@params == null || @params[0] == null)
 		{
 			object ret = haxe.lang.Runtime.slowGetField(e, constr, true);
 			if (ret is haxe.lang.Function)

+ 4 - 4
std/cs/_std/haxe/Int64.hx

@@ -27,9 +27,9 @@ using haxe.Int64;
 @:coreApi
 @:nativeGen class Int64
 {
-	@:extern private static inline function asNative(i:Int64):NativeInt64 return untyped i
-	@:extern private static inline function ofNative(i:NativeInt64):Int64 return untyped i
-	@:extern private static inline function mkNative(i:Dynamic):NativeInt64 return i
+	@:extern private static inline function asNative(i:Int64):NativeInt64 return untyped i;
+	@:extern private static inline function ofNative(i:NativeInt64):Int64 return untyped i;
+	@:extern private static inline function mkNative(i:Dynamic):NativeInt64 return i;
 
 	public static inline function make( high : Int, low : Int ) : Int64
 	{
@@ -38,7 +38,7 @@ using haxe.Int64;
 
 	public static inline function getLow( x : Int64 ) : Int
 	{
-		return cast (x.asNative() & 0xFFFFFFFF.mkNative());
+		return cast (x.asNative() & (untyped __cs__("0xFFFFFFFFL")), Int);
 	}
 
 	public static inline function getHigh( x : Int64 ) : Int {

+ 13 - 13
std/cs/_std/haxe/ds/IntMap.hx

@@ -407,37 +407,37 @@ import cs.NativeArray;
 		#end
 	}
 
-	private static inline function defaultK():Int return 0
+	private static inline function defaultK():Int return 0;
 
 	private static inline function arrayCopy(sourceArray:cs.system.Array, sourceIndex:Int, destinationArray:cs.system.Array, destinationIndex:Int, length:Int):Void
-		cs.system.Array.Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length)
+		cs.system.Array.Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length);
 
 	private static inline function getInc(k:Int, mask:Int):Int
-		return (((k) >> 3 ^ (k) << 3) | 1) & (mask)
+		return (((k) >> 3 ^ (k) << 3) | 1) & (mask);
 
 	private static inline function hash(i:Int):Int
-		return i
+		return i;
 
 	private static inline function flagIsEmpty(flag:NativeArray<Int>, i:Int):Bool
-		return ( (flag[i >> 4] >>> ((i & 0xf) << 1)) & 2 ) != 0
+		return ( (flag[i >> 4] >>> ((i & 0xf) << 1)) & 2 ) != 0;
 
 	private static inline function flagIsDel(flag:NativeArray<Int>, i:Int):Bool
-		return ((flag[i >> 4] >>> ((i & 0xf) << 1)) & 1) != 0
+		return ((flag[i >> 4] >>> ((i & 0xf) << 1)) & 1) != 0;
 
 	private static inline function isEither(flag:NativeArray<Int>, i:Int):Bool
-		return ((flag[i >> 4] >>> ((i & 0xf) << 1)) & 3) != 0
+		return ((flag[i >> 4] >>> ((i & 0xf) << 1)) & 3) != 0;
 
 	private static inline function setIsDelFalse(flag:NativeArray<Int>, i:Int):Void
-		flag[i >> 4] &= ~(1 << ((i & 0xf) << 1))
+		flag[i >> 4] &= ~(1 << ((i & 0xf) << 1));
 
 	private static inline function setIsEmptyFalse(flag:NativeArray<Int>, i:Int):Void
-		flag[i >> 4] &= ~(2 << ((i & 0xf) << 1))
+		flag[i >> 4] &= ~(2 << ((i & 0xf) << 1));
 
 	private static inline function setIsBothFalse(flag:NativeArray<Int>, i:Int):Void
-		flag[i >> 4] &= ~(3 << ((i & 0xf) << 1))
+		flag[i >> 4] &= ~(3 << ((i & 0xf) << 1));
 
 	private static inline function setIsDelTrue(flag:NativeArray<Int>, i:Int):Void
-		flag[i >> 4] |= 1 << ((i & 0xf) << 1)
+		flag[i >> 4] |= 1 << ((i & 0xf) << 1);
 
 	private static inline function roundUp(x:Int):Int
 	{
@@ -451,5 +451,5 @@ import cs.NativeArray;
 	}
 
 	private static inline function flagsSize(m:Int):Int
-		return ((m) < 16? 1 : (m) >> 4)
-}
+		return ((m) < 16? 1 : (m) >> 4);
+}

+ 5 - 5
std/cs/_std/haxe/ds/StringMap.hx

@@ -434,16 +434,16 @@ import cs.NativeArray;
 	}
 
 	@:extern private static inline function getInc(k:Int, mask:Int):Int //return 1 for linear probing
-		return (((k) >> 3 ^ (k) << 3) | 1) & (mask)
+		return (((k) >> 3 ^ (k) << 3) | 1) & (mask);
 
 	@:extern private static inline function isEither(v:HashType):Bool
-		return (v & 0xFFFFFFFE) == 0
+		return (v & 0xFFFFFFFE) == 0;
 
 	@:extern private static inline function isEmpty(v:HashType):Bool
-		return v == FLAG_EMPTY
+		return v == FLAG_EMPTY;
 
 	@:extern private static inline function isDel(v:HashType):Bool
-		return v == FLAG_DEL
+		return v == FLAG_DEL;
 
 	//guarantee: Whatever this function is, it will never return 0 nor 1
 	@:extern private static inline function hash(s:String):HashType
@@ -475,7 +475,7 @@ import cs.NativeArray;
 	}
 
 	@:extern private static inline function arrayCopy(sourceArray:cs.system.Array, sourceIndex:Int, destinationArray:cs.system.Array, destinationIndex:Int, length:Int):Void
-		cs.system.Array.Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length)
+		cs.system.Array.Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length);
 
 	@:extern private static inline function assert(x:Bool):Void
 	{

+ 0 - 26
std/java/io/Exceptions.hx

@@ -1,26 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package java.io;
-import java.lang.Throwable;
-
-extern class IOException extends Exception { }
-extern class EOFException extends IOException { }

+ 2 - 0
tests/unit/TestBasetypes.hx

@@ -368,9 +368,11 @@ class TestBasetypes extends Test {
 		var hash1:unit.MyAbstract.MyHash<String> = ["k1", "v1", "k2", "v2"];
 		eq("v1", hash1.get("k1"));
 		eq("v2", hash1.get("k2"));
+#if !cs //waiting fix for 1516
 		var hash1:unit.MyAbstract.MyHash<Int> = [1, 2, 3, 4];
 		eq(2, hash1.get("_s1"));
 		eq(4, hash1.get("_s3"));
+#end
 	}
 
 	function testAbstractToString() {

+ 11 - 0
tests/unit/compile.hxml

@@ -77,3 +77,14 @@ unit.Test
 -main unit.Test
 -java java
 -java-lib native_java/native.jar
+
+#cs
+--next
+-main unit.Test
+-cs cs
+
+#cs_unsafe
+--next
+-main unit.Test
+-D unsafe
+-cs cs_unsafe