Browse Source

[filters] Do not close monomorphs when flushing macro context

Rudy Ges 1 năm trước cách đây
mục cha
commit
8593fb756e
2 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 3 3
      src/filters/filters.ml
  2. 1 1
      src/typing/macroContext.ml

+ 3 - 3
src/filters/filters.ml

@@ -507,7 +507,7 @@ let destruction tctx detail_times main locals =
 	com.callbacks#run com.error_ext com.callbacks#get_after_filters;
 	enter_stage com CFilteringDone
 
-let update_cache_dependencies com t =
+let update_cache_dependencies ~close_monomorphs com t =
 	let visited_anons = ref [] in
 	let rec check_t m t = match t with
 		| TInst(c,tl) ->
@@ -536,7 +536,7 @@ let update_cache_dependencies com t =
 					check_t m t
 				| _ ->
 					(* Bind any still open monomorph that's part of a signature to Dynamic now (issue #10653) *)
-					Monomorph.do_bind r t_dynamic;
+					if close_monomorphs then Monomorph.do_bind r t_dynamic
 		end
 		| TLazy f ->
 			check_t m (lazy_type f)
@@ -743,7 +743,7 @@ let run tctx main before_destruction =
 	enter_stage com CSaveStart;
 	with_timer detail_times "save state" None (fun () ->
 		List.iter (fun mt ->
-			update_cache_dependencies com mt;
+			update_cache_dependencies ~close_monomorphs:true com mt;
 			save_class_state com mt
 		) new_types;
 	);

+ 1 - 1
src/typing/macroContext.ml

@@ -636,7 +636,7 @@ and flush_macro_context mint mctx =
 		FiltersCommon.remove_generic_base;
 		Exceptions.patch_constructors mctx;
 		(fun mt -> AddFieldInits.add_field_inits mctx.c.curclass.cl_path (RenameVars.init mctx.com) mctx.com mt);
-		Filters.update_cache_dependencies mctx.com;
+		Filters.update_cache_dependencies ~close_monomorphs:false mctx.com;
 		minimal_restore;
 	] in
 	let ready = fun t ->