|
@@ -325,7 +325,7 @@ let unify_field_call ctx fa el args ret p inline =
|
|
|
| (el,tf,mk_call) :: _ -> List.map fst el,tf,mk_call
|
|
|
end
|
|
|
|
|
|
- let type_generic_function ctx (e,fa) el ?(using_param=None) with_type p =
|
|
|
+let type_generic_function ctx (e,fa) el ?(using_param=None) with_type p =
|
|
|
let c,tl,cf,stat = match fa with
|
|
|
| FInstance(c,tl,cf) -> c,tl,cf,false
|
|
|
| FStatic(c,cf) -> c,[],cf,true
|
|
@@ -378,7 +378,10 @@ let unify_field_call ctx fa el args ret p inline =
|
|
|
unify_existing_field cf2.cf_type cf2.cf_pos;
|
|
|
cf2
|
|
|
in
|
|
|
- cf2
|
|
|
+ if cf.cf_name_pos = cf2.cf_name_pos then
|
|
|
+ cf2
|
|
|
+ else
|
|
|
+ error ("Cannot specialize @:generic because the generated function name is already used: " ^ name) p
|
|
|
with Not_found ->
|
|
|
let cf2 = mk_field name (map_monos cf.cf_type) cf.cf_pos cf.cf_name_pos in
|
|
|
if stat then begin
|