You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
GDScript: Add support for variadic functions
This commit is contained in:
@@ -117,6 +117,10 @@ static func get_method_signature(method: Dictionary, is_signal: bool = false) ->
|
||||
if i >= mandatory_argc:
|
||||
result += " = " + var_to_str(default_args[i - mandatory_argc])
|
||||
|
||||
if method.flags & METHOD_FLAG_VARARG:
|
||||
# `MethodInfo` does not support the rest parameter name.
|
||||
result += "...args" if args.is_empty() else ", ...args"
|
||||
|
||||
result += ")"
|
||||
if is_signal:
|
||||
if get_type(method.return, true) != "void":
|
||||
|
||||
Reference in New Issue
Block a user