File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
tutorials/scripting/gdscript Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -1651,13 +1651,20 @@ as a static type of the rest parameter:
16511651
16521652 ::
16531653
1654- func log_data(...values):
1655- # ...
1656-
1657- func other_func(...args):
1654+ func test_func(...args):
16581655 #log_data(...args) # This won't work.
16591656 log_data.callv(args) # This will work.
16601657
1658+ func log_data(...values):
1659+ # You should use `callv()` if you want to pass `values` as the argument list,
1660+ # rather than passing the array as the first argument.
1661+ prints.callv(values)
1662+ # You can use array concatenation to prepend/append the argument list.
1663+ write_data.callv(["user://log.txt"] + values)
1664+
1665+ func write_data(path, ...values):
1666+ # ...
1667+
16611668Abstract functions
16621669~~~~~~~~~~~~~~~~~~
16631670
You can’t perform that action at this time.
0 commit comments