Browse Source

[server] set the current m_added when creating m_extra

Simon Krajewski 1 year ago
parent
commit
57d2a3f560

+ 2 - 2
src/codegen/gencommon/gencommon.ml

@@ -626,11 +626,11 @@ let new_ctx con =
 		gadd_type = (fun md should_filter ->
 		gadd_type = (fun md should_filter ->
 			if should_filter then begin
 			if should_filter then begin
 				gen.gtypes_list <- md :: gen.gtypes_list;
 				gen.gtypes_list <- md :: gen.gtypes_list;
-				gen.gmodules <- { m_id = alloc_mid(); m_path = (t_path md); m_types = [md]; m_statics = None; m_extra = module_extra "" "" 0. MFake [] } :: gen.gmodules;
+				gen.gmodules <- { m_id = alloc_mid(); m_path = (t_path md); m_types = [md]; m_statics = None; m_extra = module_extra "" "" 0. MFake gen.gcon.compilation_step [] } :: gen.gmodules;
 				Hashtbl.add gen.gtypes (t_path md) md;
 				Hashtbl.add gen.gtypes (t_path md) md;
 			end else gen.gafter_filters_ended <- (fun () ->
 			end else gen.gafter_filters_ended <- (fun () ->
 				gen.gtypes_list <- md :: gen.gtypes_list;
 				gen.gtypes_list <- md :: gen.gtypes_list;
-				gen.gmodules <- { m_id = alloc_mid(); m_path = (t_path md); m_types = [md]; m_statics = None; m_extra = module_extra "" "" 0. MFake [] } :: gen.gmodules;
+				gen.gmodules <- { m_id = alloc_mid(); m_path = (t_path md); m_types = [md]; m_statics = None; m_extra = module_extra "" "" 0. MFake gen.gcon.compilation_step [] } :: gen.gmodules;
 				Hashtbl.add gen.gtypes (t_path md) md;
 				Hashtbl.add gen.gtypes (t_path md) md;
 			) :: gen.gafter_filters_ended;
 			) :: gen.gafter_filters_ended;
 		);
 		);

+ 1 - 1
src/context/typecore.ml

@@ -480,7 +480,7 @@ let create_fake_module ctx file =
 			m_path = (["$DEP"],file);
 			m_path = (["$DEP"],file);
 			m_types = [];
 			m_types = [];
 			m_statics = None;
 			m_statics = None;
-			m_extra = module_extra file (Define.get_signature ctx.com.defines) (file_time file) MFake [];
+			m_extra = module_extra file (Define.get_signature ctx.com.defines) (file_time file) MFake ctx.com.compilation_step [];
 		} in
 		} in
 		Hashtbl.add fake_modules key mdep;
 		Hashtbl.add fake_modules key mdep;
 		mdep
 		mdep

+ 2 - 2
src/core/tFunctions.ml

@@ -150,7 +150,7 @@ let mk_typedef m path pos name_pos t =
 		t_restore = (fun () -> ());
 		t_restore = (fun () -> ());
 	}
 	}
 
 
-let module_extra file sign time kind policy =
+let module_extra file sign time kind added policy =
 	{
 	{
 		m_file = Path.UniqueKey.create_lazy file;
 		m_file = Path.UniqueKey.create_lazy file;
 		m_sign = sign;
 		m_sign = sign;
@@ -160,7 +160,7 @@ let module_extra file sign time kind policy =
 			m_import_positions = PMap.empty;
 			m_import_positions = PMap.empty;
 		};
 		};
 		m_cache_state = MSGood;
 		m_cache_state = MSGood;
-		m_added = 0;
+		m_added = added;
 		m_checked = 0;
 		m_checked = 0;
 		m_time = time;
 		m_time = time;
 		m_processed = 0;
 		m_processed = 0;

+ 2 - 2
src/typing/generic.ml

@@ -181,7 +181,7 @@ let static_method_container gctx c cf p =
 			m_path = (pack,name);
 			m_path = (pack,name);
 			m_types = [];
 			m_types = [];
 			m_statics = None;
 			m_statics = None;
-			m_extra = module_extra (s_type_path (pack,name)) m.m_extra.m_sign 0. MFake m.m_extra.m_check_policy;
+			m_extra = module_extra (s_type_path (pack,name)) m.m_extra.m_sign 0. MFake gctx.ctx.com.compilation_step m.m_extra.m_check_policy;
 		} in
 		} in
 		gctx.mg <- Some mg;
 		gctx.mg <- Some mg;
 		let cg = mk_class mg (pack,name) c.cl_pos c.cl_name_pos in
 		let cg = mk_class mg (pack,name) c.cl_pos c.cl_name_pos in
@@ -282,7 +282,7 @@ let build_generic_class ctx c p tl =
 			m_path = (pack,name);
 			m_path = (pack,name);
 			m_types = [];
 			m_types = [];
 			m_statics = None;
 			m_statics = None;
-			m_extra = module_extra (s_type_path (pack,name)) m.m_extra.m_sign 0. MFake m.m_extra.m_check_policy;
+			m_extra = module_extra (s_type_path (pack,name)) m.m_extra.m_sign 0. MFake gctx.ctx.com.compilation_step m.m_extra.m_check_policy;
 		} in
 		} in
 		gctx.mg <- Some mg;
 		gctx.mg <- Some mg;
 		let cg = mk_class mg (pack,name) c.cl_pos c.cl_name_pos in
 		let cg = mk_class mg (pack,name) c.cl_pos c.cl_name_pos in

+ 1 - 1
src/typing/typeloadModule.ml

@@ -50,7 +50,7 @@ module ModuleLevel = struct
 			m_path = mpath;
 			m_path = mpath;
 			m_types = [];
 			m_types = [];
 			m_statics = None;
 			m_statics = None;
-			m_extra = module_extra (Path.get_full_path file) (Define.get_signature ctx.com.defines) (file_time file) (if ctx.com.is_macro_context then MMacro else MCode) (get_policy ctx.g mpath);
+			m_extra = module_extra (Path.get_full_path file) (Define.get_signature ctx.com.defines) (file_time file) (if ctx.com.is_macro_context then MMacro else MCode) ctx.com.compilation_step (get_policy ctx.g mpath);
 		} in
 		} in
 		m
 		m