Sfoglia il codice sorgente

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

Dan Korostelev 8 anni fa
parent
commit
608a0ad97b
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      src/generators/gencommon/overloadingConstructor.ml

+ 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 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
+		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
 		(* single expression: call to super() *)
 		let tf_args = List.map (fun (name,_,t) ->