2
0
Эх сурвалжийг харах

report missing this assignment in abstract constructor (fixed issue #1413)

Simon Krajewski 12 жил өмнө
parent
commit
9c09805d35
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  1. 4 1
      codegen.ml

+ 4 - 1
codegen.ml

@@ -1207,7 +1207,10 @@ let check_local_vars_init e =
 		match e.eexpr with
 		| TLocal v ->
 			let init = (try PMap.find v.v_id !vars with Not_found -> true) in
-			if not init then error ("Local variable " ^ v.v_name ^ " used without being initialized") e.epos;
+			if not init then begin
+				if v.v_name = "this" then error "Missing this = value" e.epos
+				else error ("Local variable " ^ v.v_name ^ " used without being initialized") e.epos
+			end
 		| TVars vl ->
 			List.iter (fun (v,eo) ->
 				match eo with