|
@@ -734,7 +734,7 @@ module TypeBinding = struct
|
|
|
let c = cctx.tclass in
|
|
|
let t = cf.cf_type in
|
|
|
let p = cf.cf_pos in
|
|
|
- let ctx = TyperManager.clone_for_expr ctx_f (if fctx.is_static then FunStatic else FunMember) false in
|
|
|
+ let ctx = TyperManager.clone_for_expr ctx_f (if fctx.is_static then FunStatic else FunMember) FunNotFunction in
|
|
|
if (has_class_flag c CInterface) then unexpected_expression ctx.com fctx "Initialization on field of interface" (pos e);
|
|
|
cf.cf_meta <- ((Meta.Value,[e],mk_zero_range_pos cf.cf_pos) :: cf.cf_meta);
|
|
|
let check_cast e =
|
|
@@ -825,9 +825,9 @@ module TypeBinding = struct
|
|
|
| Some e ->
|
|
|
bind_var_expression ctx cctx fctx cf e
|
|
|
|
|
|
- let bind_method ctx_f cctx fctx fmode cf t args ret e p =
|
|
|
+ let bind_method ctx_f cctx fctx fmode cf t args ret e function_mode p =
|
|
|
let c = cctx.tclass in
|
|
|
- let ctx = TyperManager.clone_for_expr ctx_f fmode true in
|
|
|
+ let ctx = TyperManager.clone_for_expr ctx_f fmode function_mode in
|
|
|
let bind () =
|
|
|
incr stats.s_methods_typed;
|
|
|
if ctx.com.verbose then Common.log ctx.com ("Typing " ^ (if ctx.com.is_macro_context then "macro " else "") ^ s_type_path c.cl_path ^ "." ^ cf.cf_name);
|
|
@@ -1256,7 +1256,9 @@ let create_method (ctx,cctx,fctx) c f cf fd p =
|
|
|
|
|
|
ctx.type_params <- params @ ctx.type_params;
|
|
|
let args,ret = setup_args_ret ctx cctx fctx (fst f.cff_name) fd p in
|
|
|
- let t = TFun (args#for_type,ret) in
|
|
|
+ let function_mode = FunFunction in
|
|
|
+ let targs = args#for_type in
|
|
|
+ let t = TFun (targs,ret) in
|
|
|
cf.cf_type <- t;
|
|
|
cf.cf_kind <- Method (if fctx.is_macro then MethMacro else if fctx.is_inline then MethInline else if dynamic then MethDynamic else MethNormal);
|
|
|
cf.cf_params <- params;
|
|
@@ -1327,18 +1329,18 @@ let create_method (ctx,cctx,fctx) c f cf fd p =
|
|
|
in
|
|
|
init_meta_overloads ctx (Some c) cf;
|
|
|
if fctx.do_bind then
|
|
|
- TypeBinding.bind_method ctx cctx fctx fmode cf t args ret fd.f_expr (match fd.f_expr with Some e -> snd e | None -> f.cff_pos)
|
|
|
+ TypeBinding.bind_method ctx cctx fctx fmode cf t args ret fd.f_expr function_mode (match fd.f_expr with Some e -> snd e | None -> f.cff_pos)
|
|
|
else begin
|
|
|
if fctx.is_display_field then begin
|
|
|
delay ctx.g PTypeField (fun () ->
|
|
|
(* We never enter type_function so we're missing out on the argument processing there. Let's do it here. *)
|
|
|
- let ctx = TyperManager.clone_for_expr ctx fmode true in
|
|
|
+ let ctx = TyperManager.clone_for_expr ctx fmode function_mode in
|
|
|
ignore(args#for_expr ctx)
|
|
|
);
|
|
|
check_field_display ctx fctx c cf;
|
|
|
end else
|
|
|
delay ctx.g PTypeField (fun () ->
|
|
|
- let ctx = TyperManager.clone_for_expr ctx fmode true in
|
|
|
+ let ctx = TyperManager.clone_for_expr ctx fmode function_mode in
|
|
|
args#verify_extern ctx
|
|
|
);
|
|
|
if fd.f_expr <> None then begin
|