|
@@ -362,15 +362,7 @@ let patch_class ctx c fields =
|
|
|
List.rev fields
|
|
|
|
|
|
let lazy_display_type ctx f =
|
|
|
- (* if ctx.is_display_file then begin
|
|
|
- let r = exc_protect ctx (fun r ->
|
|
|
- let t = f () in
|
|
|
- r := lazy_processing (fun () -> t);
|
|
|
- t
|
|
|
- ) "" in
|
|
|
- TLazy r
|
|
|
- end else *)
|
|
|
- f ()
|
|
|
+ f ()
|
|
|
|
|
|
type enum_abstract_mode =
|
|
|
| EAString
|
|
@@ -865,10 +857,9 @@ module TypeBinding = struct
|
|
|
mk_cast e cf.cf_type e.epos
|
|
|
end
|
|
|
in
|
|
|
- let r = exc_protect ~force:false ctx (fun r ->
|
|
|
+ let r = make_lazy ~force:false ctx t (fun r ->
|
|
|
(* type constant init fields (issue #1956) *)
|
|
|
if not !return_partial_type || (match fst e with EConst _ -> true | _ -> false) then begin
|
|
|
- r := lazy_processing (fun() -> t);
|
|
|
if (Meta.has (Meta.Custom ":debug.typing") (c.cl_meta @ cf.cf_meta)) then ctx.com.print (Printf.sprintf "Typing field %s.%s\n" (s_type_path c.cl_path) cf.cf_name);
|
|
|
let e = type_var_field ctx t e fctx.is_static fctx.is_display_field p in
|
|
|
let maybe_run_analyzer e = match e.eexpr with
|
|
@@ -944,7 +935,6 @@ module TypeBinding = struct
|
|
|
let bind_method ctx cctx fctx cf t args ret e p =
|
|
|
let c = cctx.tclass in
|
|
|
let bind r =
|
|
|
- r := lazy_processing (fun() -> t);
|
|
|
incr stats.s_methods_typed;
|
|
|
if (Meta.has (Meta.Custom ":debug.typing") (c.cl_meta @ cf.cf_meta)) then ctx.com.print (Printf.sprintf "Typing method %s.%s\n" (s_type_path c.cl_path) cf.cf_name);
|
|
|
let fmode = (match cctx.abstract with
|
|
@@ -988,7 +978,7 @@ module TypeBinding = struct
|
|
|
if not !return_partial_type then bind r;
|
|
|
t
|
|
|
in
|
|
|
- let r = exc_protect ~force:false ctx maybe_bind "type_fun" in
|
|
|
+ let r = make_lazy ~force:false ctx t maybe_bind "type_fun" in
|
|
|
bind_type ctx cctx fctx cf r p
|
|
|
end
|
|
|
|
|
@@ -1052,8 +1042,7 @@ let check_abstract (ctx,cctx,fctx) a c cf fd t ret p =
|
|
|
fctx.expr_presence_matters <- true;
|
|
|
end in
|
|
|
let handle_from () =
|
|
|
- let r = exc_protect ctx (fun r ->
|
|
|
- r := lazy_processing (fun () -> t);
|
|
|
+ let r = make_lazy ctx t (fun r ->
|
|
|
(* the return type of a from-function must be the abstract, not the underlying type *)
|
|
|
if not fctx.is_macro then (try type_eq EqStrict ret ta with Unify_error l -> raise_typing_error_ext (make_error (Unify l) p));
|
|
|
match t with
|
|
@@ -1093,8 +1082,7 @@ let check_abstract (ctx,cctx,fctx) a c cf fd t ret p =
|
|
|
let is_multitype_cast = Meta.has Meta.MultiType a.a_meta && not fctx.is_abstract_member in
|
|
|
if is_multitype_cast && not (Meta.has Meta.MultiType cf.cf_meta) then
|
|
|
cf.cf_meta <- (Meta.MultiType,[],null_pos) :: cf.cf_meta;
|
|
|
- let r = exc_protect ctx (fun r ->
|
|
|
- r := lazy_processing (fun () -> t);
|
|
|
+ let r = make_lazy ctx t (fun r ->
|
|
|
let args = if is_multitype_cast then begin
|
|
|
let ctor = try
|
|
|
PMap.find "_new" c.cl_statics
|