|
@@ -650,7 +650,6 @@ let choose_ctor gen cl tparams etl maybe_empty_t p =
|
|
unify et t;
|
|
unify et t;
|
|
check_arg arglist elist
|
|
check_arg arglist elist
|
|
with Unify_error el ->
|
|
with Unify_error el ->
|
|
- (* List.iter (fun el -> gen.gcon.warning (Error.unify_error_msg (print_context()) el) p) el; *)
|
|
|
|
false
|
|
false
|
|
)
|
|
)
|
|
| _ ->
|
|
| _ ->
|
|
@@ -768,12 +767,12 @@ let handle_type_parameter gen e e1 ef ~clean_ef ~overloads_cast_to_base f elist
|
|
| [Cannot_unify (b, TAbstract(a,params))] ->
|
|
| [Cannot_unify (b, TAbstract(a,params))] ->
|
|
let a = apply_params a.a_params params a.a_this in
|
|
let a = apply_params a.a_params params a.a_this in
|
|
if not (shallow_eq a b) then
|
|
if not (shallow_eq a b) then
|
|
- gen.gcon.warning ("This expression may be invalid") pos
|
|
|
|
|
|
+ gen.gwarning WGencommon ("This expression may be invalid") pos
|
|
| _ ->
|
|
| _ ->
|
|
- gen.gcon.warning ("This expression may be invalid") pos
|
|
|
|
|
|
+ gen.gwarning WGencommon ("This expression may be invalid") pos
|
|
)
|
|
)
|
|
| Invalid_argument _ ->
|
|
| Invalid_argument _ ->
|
|
- gen.gcon.warning ("This expression may be invalid") pos
|
|
|
|
|
|
+ gen.gwarning WGencommon ("This expression may be invalid") pos
|
|
);
|
|
);
|
|
|
|
|
|
List.map (fun t ->
|
|
List.map (fun t ->
|
|
@@ -825,7 +824,7 @@ let handle_type_parameter gen e e1 ef ~clean_ef ~overloads_cast_to_base f elist
|
|
(* f,f.cf_type, false *)
|
|
(* f,f.cf_type, false *)
|
|
select_overload gen e1.etype ((f.cf_type,f) :: List.map (fun f -> f.cf_type,f) f.cf_overloads) [] [], true
|
|
select_overload gen e1.etype ((f.cf_type,f) :: List.map (fun f -> f.cf_type,f) f.cf_overloads) [] [], true
|
|
| _ ->
|
|
| _ ->
|
|
- gen.gcon.warning "Overloaded classfield typed as anonymous" ecall.epos;
|
|
|
|
|
|
+ gen.gwarning WGencommon "Overloaded classfield typed as anonymous" ecall.epos;
|
|
(cf, actual_t, true), true
|
|
(cf, actual_t, true), true
|
|
in
|
|
in
|
|
|
|
|
|
@@ -848,7 +847,7 @@ let handle_type_parameter gen e e1 ef ~clean_ef ~overloads_cast_to_base f elist
|
|
end;
|
|
end;
|
|
{ cf_orig with cf_name = cf.cf_name },actual_t,false
|
|
{ cf_orig with cf_name = cf.cf_name },actual_t,false
|
|
| None ->
|
|
| None ->
|
|
- gen.gcon.warning "Cannot find matching overload" ecall.epos;
|
|
|
|
|
|
+ gen.gwarning WGencommon "Cannot find matching overload" ecall.epos;
|
|
cf, actual_t, true
|
|
cf, actual_t, true
|
|
else
|
|
else
|
|
cf,actual_t,error
|
|
cf,actual_t,error
|
|
@@ -930,7 +929,7 @@ let handle_type_parameter gen e e1 ef ~clean_ef ~overloads_cast_to_base f elist
|
|
elist);
|
|
elist);
|
|
}, elist
|
|
}, elist
|
|
with Invalid_argument _ ->
|
|
with Invalid_argument _ ->
|
|
- gen.gcon.warning ("This expression may be invalid" ) ecall.epos;
|
|
|
|
|
|
+ gen.gwarning WGencommon ("This expression may be invalid" ) ecall.epos;
|
|
{ ecall with eexpr = TCall({ e1 with eexpr = TField(!ef, f) }, elist) }, elist
|
|
{ ecall with eexpr = TCall({ e1 with eexpr = TField(!ef, f) }, elist) }, elist
|
|
in
|
|
in
|
|
let new_ecall = if fparams <> [] then gen.gparam_func_call new_ecall { e1 with eexpr = TField(!ef, f) } fparams elist else new_ecall in
|
|
let new_ecall = if fparams <> [] then gen.gparam_func_call new_ecall { e1 with eexpr = TField(!ef, f) } fparams elist else new_ecall in
|
|
@@ -960,7 +959,7 @@ let handle_type_parameter gen e e1 ef ~clean_ef ~overloads_cast_to_base f elist
|
|
*)
|
|
*)
|
|
| _ ->
|
|
| _ ->
|
|
let pt = match e with | None -> real_type | Some _ -> snd (get_fun e1.etype) in
|
|
let pt = match e with | None -> real_type | Some _ -> snd (get_fun e1.etype) in
|
|
- let _params = match follow pt with | TEnum(_, p) -> p | _ -> gen.gcon.warning (debug_expr e1) e1.epos; die "" __LOC__ in
|
|
|
|
|
|
+ let _params = match follow pt with | TEnum(_, p) -> p | _ -> gen.gwarning WGencommon (debug_expr e1) e1.epos; die "" __LOC__ in
|
|
let args, ret = get_fun efield.ef_type in
|
|
let args, ret = get_fun efield.ef_type in
|
|
let actual_t = TFun(List.map (fun (n,o,t) -> (n,o,gen.greal_type t)) args, gen.greal_type ret) in
|
|
let actual_t = TFun(List.map (fun (n,o,t) -> (n,o,gen.greal_type t)) args, gen.greal_type ret) in
|
|
(*
|
|
(*
|
|
@@ -1144,7 +1143,7 @@ let configure gen ?(overloads_cast_to_base = false) maybe_empty_t calls_paramete
|
|
let base_type = match follow et with
|
|
let base_type = match follow et with
|
|
| TInst({ cl_path = ([], "Array") } as cl, bt) -> gen.greal_type_param (TClassDecl cl) bt
|
|
| TInst({ cl_path = ([], "Array") } as cl, bt) -> gen.greal_type_param (TClassDecl cl) bt
|
|
| _ ->
|
|
| _ ->
|
|
- gen.gcon.warning (debug_type et) e.epos;
|
|
|
|
|
|
+ gen.gwarning WGencommon (debug_type et) e.epos;
|
|
(match gen.gcurrent_class with
|
|
(match gen.gcurrent_class with
|
|
| Some cl -> print_endline (s_type_path cl.cl_path)
|
|
| Some cl -> print_endline (s_type_path cl.cl_path)
|
|
| _ -> ());
|
|
| _ -> ());
|
|
@@ -1188,7 +1187,7 @@ let configure gen ?(overloads_cast_to_base = false) maybe_empty_t calls_paramete
|
|
) (wrap_rest_args gen (TFun (args,rt)) eparams e.epos) args in
|
|
) (wrap_rest_args gen (TFun (args,rt)) eparams e.epos) args in
|
|
{ e with eexpr = TCall(ef, eparams) }
|
|
{ e with eexpr = TCall(ef, eparams) }
|
|
with | Not_found ->
|
|
with | Not_found ->
|
|
- gen.gcon.warning "No overload found for this constructor call" e.epos;
|
|
|
|
|
|
+ gen.gwarning WGencommon "No overload found for this constructor call" e.epos;
|
|
{ e with eexpr = TCall(ef, List.map run eparams) })
|
|
{ e with eexpr = TCall(ef, List.map run eparams) })
|
|
| TCall (ef, eparams) ->
|
|
| TCall (ef, eparams) ->
|
|
(match ef.etype with
|
|
(match ef.etype with
|
|
@@ -1216,7 +1215,7 @@ let configure gen ?(overloads_cast_to_base = false) maybe_empty_t calls_paramete
|
|
) (wrap_rest_args gen (TFun (args,rt)) eparams e.epos) args in
|
|
) (wrap_rest_args gen (TFun (args,rt)) eparams e.epos) args in
|
|
{ e with eexpr = TNew(cl, tparams, eparams) }
|
|
{ e with eexpr = TNew(cl, tparams, eparams) }
|
|
with | Not_found ->
|
|
with | Not_found ->
|
|
- gen.gcon.warning "No overload found for this constructor call" e.epos;
|
|
|
|
|
|
+ gen.gwarning WGencommon "No overload found for this constructor call" e.epos;
|
|
{ e with eexpr = TNew(cl, tparams, List.map run eparams) })
|
|
{ e with eexpr = TNew(cl, tparams, List.map run eparams) })
|
|
| TUnop((Increment | Decrement) as op, flag, ({ eexpr = TArray (arr, idx) } as e2))
|
|
| TUnop((Increment | Decrement) as op, flag, ({ eexpr = TArray (arr, idx) } as e2))
|
|
when (match follow arr.etype with TInst({ cl_path = ["cs"],"NativeArray" },_) -> true | _ -> false) ->
|
|
when (match follow arr.etype with TInst({ cl_path = ["cs"],"NativeArray" },_) -> true | _ -> false) ->
|