Skip to content

Commit 1c9f566

Browse files
committed
[cpp] Remove overrides from __scriptableFunctions
1 parent b344639 commit 1c9f566

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/generators/cpp/gen/cppGenClassImplementation.ml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -977,18 +977,20 @@ let generate_managed_class base_ctx tcpp_class =
977977
if List.length tcpp_class.tcl_functions > 0 || List.length tcpp_class.tcl_static_functions > 0 then (
978978

979979
let dump_script is_static f acc =
980-
let signature = generate_script_function is_static f.tcf_field ("__s_" ^ f.tcf_field.cf_name) f.tcf_name in
981-
let superCall = if is_static then "0" else "__s_" ^ f.tcf_field.cf_name ^ "<true>" in
982-
let named =
983-
Printf.sprintf
984-
"\t::hx::ScriptNamedFunction(\"%s\", __s_%s, \"%s\", %s HXCPP_CPPIA_SUPER_ARG(%s))"
985-
f.tcf_field.cf_name
986-
f.tcf_field.cf_name
987-
signature
988-
(if is_static then "true" else "false")
989-
superCall in
990-
991-
named :: acc
980+
if not f.tcf_is_overriding then
981+
let signature = generate_script_function is_static f.tcf_field ("__s_" ^ f.tcf_field.cf_name) f.tcf_name in
982+
let superCall = if is_static then "0" else "__s_" ^ f.tcf_field.cf_name ^ "<true>" in
983+
let named =
984+
Printf.sprintf
985+
"\t::hx::ScriptNamedFunction(\"%s\", __s_%s, \"%s\", %s HXCPP_CPPIA_SUPER_ARG(%s))"
986+
f.tcf_field.cf_name
987+
f.tcf_field.cf_name
988+
signature
989+
(if is_static then "true" else "false")
990+
superCall in
991+
992+
named :: acc
993+
else acc
992994
in
993995

994996
let sigs =

0 commit comments

Comments
 (0)