|
@@ -51,7 +51,7 @@ let run ~explicit_fn_name ~get_vmtype gen =
|
|
|
(* overrides can be removed from interfaces *)
|
|
|
c.cl_ordered_fields <- List.filter (fun f ->
|
|
|
try
|
|
|
- if Meta.has Meta.Overload f.cf_meta then raise Not_found;
|
|
|
+ if has_class_field_flag f CfOverload then raise Not_found;
|
|
|
let f2 = Codegen.find_field gen.gcon c f in
|
|
|
if f2 == f then raise Not_found;
|
|
|
c.cl_fields <- PMap.remove f.cf_name c.cl_fields;
|
|
@@ -75,7 +75,7 @@ let run ~explicit_fn_name ~get_vmtype gen =
|
|
|
try
|
|
|
let t2, f2 =
|
|
|
match overloads with
|
|
|
- | (_, cf) :: _ when Meta.has Meta.Overload cf.cf_meta -> (* overloaded function *)
|
|
|
+ | (_, cf) :: _ when has_class_field_flag cf CfOverload -> (* overloaded function *)
|
|
|
(* try to find exact function *)
|
|
|
List.find (fun (t,f2) ->
|
|
|
Overloads.same_overload_args ~get_vmtype ftype t f f2
|
|
@@ -163,7 +163,7 @@ let run ~explicit_fn_name ~get_vmtype gen =
|
|
|
(* now go through all overrides, *)
|
|
|
let rec check_f f =
|
|
|
(* find the first declared field *)
|
|
|
- let is_overload = Meta.has Meta.Overload f.cf_meta in
|
|
|
+ let is_overload = has_class_field_flag f CfOverload in
|
|
|
let decl = if is_overload then
|
|
|
find_first_declared_field gen c ~get_vmtype ~exact_field:f f.cf_name
|
|
|
else
|
|
@@ -203,9 +203,9 @@ let run ~explicit_fn_name ~get_vmtype gen =
|
|
|
with Unify_error _ -> false) current_args original_args
|
|
|
| _ -> Globals.die "" __LOC__
|
|
|
in
|
|
|
- if (not (Meta.has Meta.Overload f.cf_meta) && has_contravariant_args) then
|
|
|
- f.cf_meta <- (Meta.Overload, [], f.cf_pos) :: f.cf_meta;
|
|
|
- if Meta.has Meta.Overload f.cf_meta then begin
|
|
|
+ if (not (has_class_field_flag f CfOverload) && has_contravariant_args) then
|
|
|
+ add_class_field_flag f CfOverload;
|
|
|
+ if has_class_field_flag f CfOverload then begin
|
|
|
(* if it is overload, create another field with the requested type *)
|
|
|
let f3 = mk_class_field f.cf_name t (has_class_field_flag f CfPublic) f.cf_pos f.cf_kind f.cf_params in
|
|
|
let p = f.cf_pos in
|