Rudy Ges 1 рік тому
батько
коміт
bb05bd4a2d

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

@@ -393,7 +393,7 @@ class ['a] hxb_writer
 			chunk#write_byte 7;
 			chunk#write_byte 7;
 			chunk#write_uleb128 index;
 			chunk#write_uleb128 index;
 		with Not_found ->
 		with Not_found ->
-			print_endline (Printf.sprintf "[%s] %s Unbound type parameter %s (%s)" (s_type_path current_module.m_path) todo_error (s_type_path c.cl_path) (snd c.cl_path));
+			(* print_endline (Printf.sprintf "[%s] %s Unbound type parameter %s (%s)" (s_type_path current_module.m_path) todo_error (s_type_path c.cl_path) (snd c.cl_path)); *)
 			(* DynArray.iter (fun ttp -> debug_msg (Printf.sprintf "FTP %s %s" ttp.ttp_name (s_type_kind ttp.ttp_type)) field_type_parameters#items); *)
 			(* DynArray.iter (fun ttp -> debug_msg (Printf.sprintf "FTP %s %s" ttp.ttp_name (s_type_kind ttp.ttp_type)) field_type_parameters#items); *)
 			(* DynArray.iter (fun ttp -> debug_msg (Printf.sprintf "TTP %s %s" ttp.ttp_name (s_type_kind ttp.ttp_type)) type_type_parameters#items); *)
 			(* DynArray.iter (fun ttp -> debug_msg (Printf.sprintf "TTP %s %s" ttp.ttp_name (s_type_kind ttp.ttp_type)) type_type_parameters#items); *)
 			(* print_stacktrace (); *)
 			(* print_stacktrace (); *)

+ 2 - 2
src/compiler/serverCompilationContext.ml

@@ -59,9 +59,9 @@ let reset sctx =
 
 
 let after_save sctx com has_error =
 let after_save sctx com has_error =
 	if not has_error && com.display.dms_full_typing && com.display.dms_populate_cache then begin
 	if not has_error && com.display.dms_full_typing && com.display.dms_populate_cache then begin
-		(* let t = Timer.timer ["server";"cache context"] in *)
+		let t = Timer.timer ["server";"cache context"] in
 		CommonCache.cache_context sctx.cs com;
 		CommonCache.cache_context sctx.cs com;
-		(* t(); *)
+		t();
 		ServerMessage.cached_modules com "" (List.length com.modules);
 		ServerMessage.cached_modules com "" (List.length com.modules);
 	end
 	end
 
 

+ 2 - 0
src/context/common.ml

@@ -838,6 +838,8 @@ let log com str =
 	if com.verbose then com.print (str ^ "\n")
 	if com.verbose then com.print (str ^ "\n")
 
 
 let clone com is_macro_context =
 let clone com is_macro_context =
+	(* trace (Printf.sprintf "Common.clone was_macro=%b is_macro=%b" com.is_macro_context is_macro_context); *)
+	(* trace_call_stack (); *)
 	let t = com.basic in
 	let t = com.basic in
 	{ com with
 	{ com with
 		cache = None;
 		cache = None;

+ 2 - 1
src/core/globals.ml

@@ -171,7 +171,8 @@ let die ?p msg ml_loc =
 	in
 	in
 	let ver = s_version_full
 	let ver = s_version_full
 	and os_type = if Sys.unix then "unix" else "windows" in
 	and os_type = if Sys.unix then "unix" else "windows" in
-	Printf.eprintf "%s\nHaxe: %s; OS type: %s;\n%s\n%s" msg ver os_type ml_loc backtrace;
+	(* Printf.eprintf "%s\nHaxe: %s; OS type: %s;\n%s\n%s" msg ver os_type ml_loc backtrace; *)
+	trace (Printf.sprintf "%s\nHaxe: %s; OS type: %s;\n%s\n%s" msg ver os_type ml_loc backtrace);
 	assert false
 	assert false
 
 
 module MessageSeverity = struct
 module MessageSeverity = struct

+ 2 - 1
src/generators/genhl.ml

@@ -4153,7 +4153,8 @@ let generate com =
 	end else
 	end else
 
 
 	let ctx = create_context com false dump in
 	let ctx = create_context com false dump in
-	add_types ctx com.types;
+	(try add_types ctx com.types with Not_found -> trace (Printexc.get_backtrace ()); raise Not_found);
+
 	let code = build_code ctx com.types com.main in
 	let code = build_code ctx com.types com.main in
 	Array.sort (fun (lib1,_,_,_) (lib2,_,_,_) -> lib1 - lib2) code.natives;
 	Array.sort (fun (lib1,_,_,_) (lib2,_,_,_) -> lib1 - lib2) code.natives;
 	if dump then begin
 	if dump then begin

+ 1 - 0
src/typing/typer.ml

@@ -2028,6 +2028,7 @@ and type_expr ?(mode=MGet) ctx (e,p) (with_type:WithType.t) =
 (* TYPER INITIALIZATION *)
 (* TYPER INITIALIZATION *)
 
 
 let create com macros =
 let create com macros =
+	(* trace (Printf.sprintf "Typer.create with_macro=%b" (Option.is_some macros)); *)
 	let ctx = {
 	let ctx = {
 		com = com;
 		com = com;
 		t = com.basic;
 		t = com.basic;

+ 1 - 1
tests/server/build.hxml

@@ -6,7 +6,7 @@
 -lib utest
 -lib utest
 -lib haxeserver
 -lib haxeserver
 -D analyzer-optimize
 -D analyzer-optimize
-# -D UTEST_PATTERN=9087
+# -D UTEST_PATTERN=9029
 # or set UTEST_PATTERN environment variable
 # or set UTEST_PATTERN environment variable
 
 
 #Temporary. To find out what's wrong with random CI failures
 #Temporary. To find out what's wrong with random CI failures

+ 4 - 1
tests/server/src/cases/issues/Issue9029.hx

@@ -7,9 +7,12 @@ class Issue9029 extends TestCase {
 		vfs.putContent("Screen.hx", getTemplate("issues/Issue9029/Screen.hx"));
 		vfs.putContent("Screen.hx", getTemplate("issues/Issue9029/Screen.hx"));
 		var args = ["-main", "Main", "-D", "analyzer-optimize", "--interp"];
 		var args = ["-main", "Main", "-D", "analyzer-optimize", "--interp"];
 		runHaxe(args);
 		runHaxe(args);
+		debugErrorMessages();
+		assertSuccess();
 		vfs.putContent("Game.hx", getTemplate("issues/Issue9029/Game.hx.modified"));
 		vfs.putContent("Game.hx", getTemplate("issues/Issue9029/Game.hx.modified"));
 		runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("Game.hx")});
 		runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("Game.hx")});
 		runHaxe(args);
 		runHaxe(args);
+		debugErrorMessages();
 		assertSuccess();
 		assertSuccess();
 	}
 	}
-}
+}