|
@@ -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;
|