瀏覽代碼

[java/cs] Properly recurse when Type.enumIndex optimization does not
suceed

Cauê Waneck 10 年之前
父節點
當前提交
216083e663
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      gencommon.ml

+ 2 - 2
gencommon.ml

@@ -9181,12 +9181,12 @@ struct
 				in
 				in
 
 
 				match e.eexpr with
 				match e.eexpr with
-					| TCall ({eexpr = TField(_, FStatic({cl_path=[],"Type"},{cf_name="enumIndex"}))}, [f]) ->
+					| TCall (({eexpr = TField(_, FStatic({cl_path=[],"Type"},{cf_name="enumIndex"}))} as left), [f]) ->
 						let f = run f in
 						let f = run f in
 						(try
 						(try
 							mk_field_access gen {f with etype = get_converted_enum_type f.etype} "index" e.epos
 							mk_field_access gen {f with etype = get_converted_enum_type f.etype} "index" e.epos
 						with Not_found ->
 						with Not_found ->
-							e)
+							{ e with eexpr = TCall(left, [f]) })
 					| TEnumParameter(f, _,i) ->
 					| TEnumParameter(f, _,i) ->
 						let f = run f in
 						let f = run f in
 						(* check if en was converted to class *)
 						(* check if en was converted to class *)