ソースを参照

place override functions in the results at least once (#11773)

Aidan Lee 10 ヶ月 前
コミット
0af66ab76c
1 ファイル変更4 行追加1 行削除
  1. 4 1
      src/generators/gencpp.ml

+ 4 - 1
src/generators/gencpp.ml

@@ -4411,7 +4411,10 @@ let current_virtual_functions_rev clazz base_functions =
       | _, Method MethDynamic -> result
       | TFun (args,return_type), Method _  ->
           if (is_override elem ) then
-             List.map (fun (e,a,r) ->  if e.cf_name<>elem.cf_name then (e,a,r) else  (elem,args,return_type) ) result
+            if List.exists (fun (e,a,r) -> e.cf_name=elem.cf_name ) result then
+               result
+            else
+               (elem,args,return_type) :: result
           else
              (elem,args,return_type) :: result
       | _,_ -> result