Răsfoiți Sursa

[As3] fix for the accessor fix

Simon Krajewski 12 ani în urmă
părinte
comite
10fb043cf0
1 a modificat fișierele cu 6 adăugiri și 5 ștergeri
  1. 6 5
      genas3.ml

+ 6 - 5
genas3.ml

@@ -584,11 +584,12 @@ and gen_expr ctx e =
 		gen_field_access ctx e1.etype (field_name s)
 	| TField (e,fa) ->
    		gen_value ctx e;
-   		let s = match extract_field fa with
-   			| Some cf when is_getset cf -> "$" ^ cf.cf_name
-   			| Some cf -> cf.cf_name
-   			| None -> field_name fa
-   		in
+		let s = match fa with
+			| FStatic(c,cf) | FInstance(c,cf) -> if ctx.curclass == c && is_getset cf then "$" ^ cf.cf_name else cf.cf_name
+			| FClosure (_,cf) | FAnon cf -> cf.cf_name
+			| FEnum(_,ef) -> ef.ef_name
+			| FDynamic n -> n
+		in
 		gen_field_access ctx e.etype s
 	| TTypeExpr t ->
 		spr ctx (s_path ctx true (t_path t) e.epos)