GDScript: Add support for variadic functions
This commit is contained in:
parent
3b963ab8b6
commit
ee121ef80e
33 changed files with 416 additions and 65 deletions
|
|
@ -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":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue