1
0
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:
Danil Alexeev
2025-03-30 12:59:05 +03:00
parent 3b963ab8b6
commit ee121ef80e
33 changed files with 416 additions and 65 deletions

View File

@@ -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":