Selaa lähdekoodia

(As3) make private @:op functions public in output (closes #2596)

Simon Krajewski 11 vuotta sitten
vanhempi
commit
29c4b857e8
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      genas3.ml

+ 2 - 1
genas3.ml

@@ -930,7 +930,8 @@ let generate_field ctx static f =
 			print ctx "]";
 			print ctx "]";
 		| _ -> ()
 		| _ -> ()
 	) f.cf_meta;
 	) f.cf_meta;
-	let public = f.cf_public || Hashtbl.mem ctx.get_sets (f.cf_name,static) || (f.cf_name = "main" && static) || f.cf_name = "resolve" || Ast.Meta.has Ast.Meta.Public f.cf_meta in
+	let public = f.cf_public || Hashtbl.mem ctx.get_sets (f.cf_name,static) || (f.cf_name = "main" && static)
+	    || f.cf_name = "resolve" || Ast.Meta.has Ast.Meta.Public f.cf_meta || (match ctx.curclass.cl_kind with KAbstractImpl _ -> Ast.Meta.has Ast.Meta.Op f.cf_meta | _ -> false) in
 	let rights = (if static then "static " else "") ^ (if public then "public" else "protected") in
 	let rights = (if static then "static " else "") ^ (if public then "public" else "protected") in
 	let p = ctx.curclass.cl_pos in
 	let p = ctx.curclass.cl_pos in
 	match f.cf_expr, f.cf_kind with
 	match f.cf_expr, f.cf_kind with