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
No known key found for this signature in database
GPG key ID: 5A52F75A8679EC57
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":