Explorar el Código

[flash] load const vars as final

Dan Korostelev hace 6 años
padre
commit
e5dd28c46f
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      src/codegen/swfLoader.ml

+ 4 - 4
src/codegen/swfLoader.ml

@@ -218,10 +218,10 @@ let build_class com c file =
 		} in
 		} in
 		match f.hlf_kind with
 		match f.hlf_kind with
 		| HFVar v ->
 		| HFVar v ->
-			if v.hlv_const then
-				cf.cff_kind <- FProp (("default",null_pos),("never",null_pos),Some (make_type v.hlv_type,null_pos),None)
-			else
-				cf.cff_kind <- FVar (Some (make_dyn_type v.hlv_type,null_pos),None);
+			cf.cff_kind <- FVar (Some (make_dyn_type v.hlv_type,null_pos),None);
+			if v.hlv_const then begin
+				cf.cff_access <- (AFinal,null_pos) :: cf.cff_access;
+			end;
 			cf :: acc
 			cf :: acc
 		| HFMethod m when m.hlm_override ->
 		| HFMethod m when m.hlm_override ->
 			Hashtbl.add override (name,stat) ();
 			Hashtbl.add override (name,stat) ();