You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
GDScript: Add support for variadic functions
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
func f(...args, extra_arg):
|
||||
pass
|
||||
|
||||
func test():
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
Cannot have parameters after the rest parameter.
|
||||
@@ -0,0 +1,5 @@
|
||||
func f(...args, ...more_args):
|
||||
pass
|
||||
|
||||
func test():
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
Cannot have parameters after the rest parameter.
|
||||
@@ -0,0 +1,5 @@
|
||||
func f(...args = []):
|
||||
pass
|
||||
|
||||
func test():
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
The rest parameter cannot have a default value.
|
||||
@@ -0,0 +1,5 @@
|
||||
static func _static_init(...args) -> void:
|
||||
pass
|
||||
|
||||
func test():
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
Static constructor cannot have parameters.
|
||||
Reference in New Issue
Block a user