File tree 1 file changed +10
-4
lines changed
godot-macros/src/class/data_models
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -196,21 +196,25 @@ fn process_godot_fns(
196
196
197
197
// For virtual methods, rename/mangle existing user method and create a new method with the original name,
198
198
// which performs a dynamic dispatch.
199
- if func. is_virtual {
200
- add_virtual_script_call (
199
+ let registered_name = if func. is_virtual {
200
+ let registered_name = add_virtual_script_call (
201
201
& mut virtual_functions,
202
202
function,
203
203
& signature_info,
204
204
class_name,
205
205
& func. rename ,
206
206
gd_self_parameter,
207
207
) ;
208
+
209
+ Some ( registered_name)
210
+ } else {
211
+ func. rename
208
212
} ;
209
213
210
214
func_definitions. push ( FuncDefinition {
211
215
signature_info,
212
216
external_attributes,
213
- registered_name : func . rename ,
217
+ registered_name,
214
218
is_script_virtual : func. is_virtual ,
215
219
rpc_info,
216
220
} ) ;
@@ -295,7 +299,7 @@ fn add_virtual_script_call(
295
299
class_name : & Ident ,
296
300
rename : & Option < String > ,
297
301
gd_self_parameter : Option < Ident > ,
298
- ) {
302
+ ) -> String {
299
303
assert ! ( cfg!( since_api = "4.3" ) ) ;
300
304
301
305
// Update parameter names, so they can be forwarded (e.g. a "_" declared by the user cannot).
@@ -363,6 +367,8 @@ fn add_virtual_script_call(
363
367
364
368
std:: mem:: swap ( & mut function. body , & mut early_bound_function. body ) ;
365
369
virtual_functions. push ( early_bound_function) ;
370
+
371
+ method_name_str
366
372
}
367
373
368
374
fn extract_attributes < T > ( item : & mut T ) -> ParseResult < Option < ItemAttr > >
You can’t perform that action at this time.
0 commit comments