Browse Source

[cs/java] carry over @:protected meta when copying constructor

Dan Korostelev 8 năm trước cách đây
mục cha
commit
608a0ad97b

+ 2 - 0
src/generators/gencommon/overloadingConstructor.ml

@@ -223,6 +223,8 @@ let create_static_ctor com ~empty_ctor_expr cl ctor follow_type =
 let clone_ctors com ctor sup stl cl =
 let clone_ctors com ctor sup stl cl =
 	let rec clone cf =
 	let rec clone cf =
 		let ncf = mk_class_field "new" (apply_params sup.cl_params stl cf.cf_type) cf.cf_public cf.cf_pos cf.cf_kind cf.cf_params in
 		let ncf = mk_class_field "new" (apply_params sup.cl_params stl cf.cf_type) cf.cf_public cf.cf_pos cf.cf_kind cf.cf_params in
+		if Meta.has Meta.Protected cf.cf_meta then
+			ncf.cf_meta <- (Meta.Protected,[],ncf.cf_pos) :: ncf.cf_meta;
 		let args, ret = get_fun ncf.cf_type in
 		let args, ret = get_fun ncf.cf_type in
 		(* single expression: call to super() *)
 		(* single expression: call to super() *)
 		let tf_args = List.map (fun (name,_,t) ->
 		let tf_args = List.map (fun (name,_,t) ->