Simon Krajewski 3 lat temu
rodzic
commit
dc33d67862

+ 3 - 1
src/context/display/diagnostics.ml

@@ -177,7 +177,9 @@ let prepare com =
 	dctx
 
 let secure_generated_code ctx e =
-	mk (TMeta((Meta.Extern,[],e.epos),e)) e.etype e.epos
+	(* This causes problems and sucks in general... need a different solution. But I forgot which problem this solved anyway. *)
+	(* mk (TMeta((Meta.Extern,[],e.epos),e)) e.etype e.epos *)
+	e
 
 let print com =
 	let dctx = prepare com in

+ 2 - 6
src/typing/typeloadFields.ml

@@ -852,9 +852,7 @@ module TypeBinding = struct
 					| _ -> !analyzer_run_on_expr_ref ctx.com e
 				in
 				let require_constant_expression e msg =
-					if ctx.com.display.dms_kind <> DMNone then
-						e
-					else match Optimizer.make_constant_expression ctx (maybe_run_analyzer e) with
+					match Optimizer.make_constant_expression ctx (maybe_run_analyzer e) with
 					| Some e -> e
 					| None -> display_error ctx msg p; e
 				in
@@ -871,9 +869,7 @@ module TypeBinding = struct
 					(* disallow initialization of non-physical fields (issue #1958) *)
 					display_error ctx "This field cannot be initialized because it is not a real variable" p; e
 				| Var v when not fctx.is_static ->
-					let e = if ctx.com.display.dms_display then
-						e
-					else begin
+					let e = begin
 						let rec check_this e = match e.eexpr with
 							| TConst TThis ->
 								display_error ctx "Cannot access this or other member field in variable initialization" e.epos;