Browse Source

put the dodge in place, activate

see #11498
Simon Krajewski 1 year ago
parent
commit
8505558440

+ 1 - 1
src/compiler/hxb/hxbReader.ml

@@ -1629,7 +1629,7 @@ class hxb_reader
 					cf.cf_expr <- Some e;
 					cf.cf_expr_unoptimized <- e_unopt;
 				in
-				if true || api#read_expression_eagerly cf then
+				if api#read_expression_eagerly cf then
 					read_expressions ()
 				else begin
 					let t = cf.cf_type in

+ 1 - 1
src/compiler/server.ml

@@ -456,7 +456,7 @@ class hxb_reader_api_server
 		i
 
 	method read_expression_eagerly (cf : tclass_field) =
-		false (* TODO: Check this please Rudy! *)
+		true (* TODO: Check this please Rudy! *)
 end
 
 let handle_cache_bound_objects com cbol =

+ 6 - 1
src/typing/typeloadModule.ml

@@ -801,7 +801,12 @@ class hxb_reader_api_typeload
 		!uid
 
 	method read_expression_eagerly (cf : tclass_field) =
-		ctx.com.is_macro_context
+		ctx.com.is_macro_context || match cf.cf_kind with
+			| Var _ ->
+				true
+			| Method _ ->
+				delay ctx PTypeField (fun () -> ignore(follow cf.cf_type));
+				false
 end
 
 let rec load_hxb_module ctx path p =

+ 0 - 0
tests/unit/src/unit/issues/Issue3725.hx → tests/unit/src/unit/issues/Issue3725.hx.disabled