Explorar el Código

generate final fields without access modifiers in --gen-hx-classes

Dan Korostelev hace 6 años
padre
commit
9e8d6263e0
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6 2
      src/codegen/genxml.ml

+ 6 - 2
src/codegen/genxml.ml

@@ -445,8 +445,12 @@ let generate_type com t =
 		in
 		(match f.cf_kind with
 		| Var v ->
-			p "var %s" name;
-			if v.v_read <> AccNormal || v.v_write <> AccNormal then p "(%s,%s)" (access true v.v_read) (access false v.v_write);
+			if has_class_field_flag f CfFinal then
+				p "final %s" name
+			else begin
+				p "var %s" name;
+				if v.v_read <> AccNormal || v.v_write <> AccNormal then p "(%s,%s)" (access true v.v_read) (access false v.v_write);
+			end;
 			p " : %s" (stype f.cf_type);
 		| Method m ->
 			let params, ret = (match follow f.cf_type with