Browse Source

avoid problems

Simon Krajewski 3 years ago
parent
commit
dc33d67862
2 changed files with 5 additions and 7 deletions
  1. 3 1
      src/context/display/diagnostics.ml
  2. 2 6
      src/typing/typeloadFields.ml

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

@@ -177,7 +177,9 @@ let prepare com =
 	dctx
 	dctx
 
 
 let secure_generated_code ctx e =
 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 print com =
 	let dctx = prepare com in
 	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
 					| _ -> !analyzer_run_on_expr_ref ctx.com e
 				in
 				in
 				let require_constant_expression e msg =
 				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
 					| Some e -> e
 					| None -> display_error ctx msg p; e
 					| None -> display_error ctx msg p; e
 				in
 				in
@@ -871,9 +869,7 @@ module TypeBinding = struct
 					(* disallow initialization of non-physical fields (issue #1958) *)
 					(* 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
 					display_error ctx "This field cannot be initialized because it is not a real variable" p; e
 				| Var v when not fctx.is_static ->
 				| 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
 						let rec check_this e = match e.eexpr with
 							| TConst TThis ->
 							| TConst TThis ->
 								display_error ctx "Cannot access this or other member field in variable initialization" e.epos;
 								display_error ctx "Cannot access this or other member field in variable initialization" e.epos;