Explorar el Código

move diagnostics handling back to after-compilation

We miss out on too much typing otherwise. Let's see how slow this really makes it.
Simon Krajewski hace 9 años
padre
commit
f27fd9a904
Se han modificado 2 ficheros con 2 adiciones y 18 borrados
  1. 2 1
      src/main.ml
  2. 0 17
      src/typing/typeload.ml

+ 2 - 1
src/main.ml

@@ -1599,7 +1599,7 @@ try
 		t();
 		if ctx.has_error then raise Abort;
 		begin match ctx.com.display with
-			| DMNone | DMUsage ->
+			| DMNone | DMUsage | DMDiagnostics ->
 				()
 			| _ ->
 				if ctx.has_next then raise Abort;
@@ -1612,6 +1612,7 @@ try
 		com.modules <- modules;
 		begin match com.display with
 			| DMUsage -> Codegen.detect_usage com;
+			| DMDiagnostics -> raise (Display.Diagnostics (Display.Diagnostics.print_diagnostics ctx.com))
 			| _ -> ()
 		end;
 		Filters.run com tctx main;

+ 0 - 17
src/typing/typeload.ml

@@ -3485,23 +3485,6 @@ let type_module ctx mpath file ?(is_extern=false) tdecls p =
 	let ctx = type_types_into_module ctx m tdecls p in
 	if is_extern then m.m_extra.m_kind <- MExtern;
 	begin if ctx.is_display_file then match ctx.com.display with
-		| DMDiagnostics ->
-			List.iter (fun mt -> match mt with
-				| TClassDecl c | TAbstractDecl({a_impl = Some c}) ->
-					ignore(c.cl_build());
-					let field cf = match cf.cf_kind with
-						| Method MethMacro ->
-							(try ignore (ctx.g.do_macro ctx MDisplay c.cl_path cf.cf_name [] p) with Exit -> ())
-						| _ ->
-							ignore(follow cf.cf_type);
-					in
-					List.iter field c.cl_ordered_fields;
-					List.iter field c.cl_ordered_statics;
-					(match c.cl_constructor with None -> () | Some cf -> field cf);
-				| _ ->
-					()
-			) m.m_types;
-			raise (Display.Diagnostics (Display.Diagnostics.print_diagnostics ctx.com))
 		| DMResolve s ->
 			resolve_position_by_path ctx {tname = s; tpackage = []; tsub = None; tparams = []} p
 		| _ ->