Skip to content

Conversation

@dalexeev
Copy link
Member

@dalexeev dalexeev added this to the 4.6 milestone Nov 27, 2025
@dalexeev dalexeev added enhancement topic:gdscript area:manual Issues and PRs related to the Manual/Tutorials section of the documentation cherrypick:4.5 labels Nov 27, 2025
Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@AThousandShips AThousandShips removed this from the 4.6 milestone Nov 27, 2025
Copy link
Member

@mhilbrunner mhilbrunner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content as is looks good to me. Should this really be in the comment instead of an explanation outside the code block, thinking about translations and such?

@MikeSchulze
Copy link

MikeSchulze commented Dec 10, 2025

What's about constructors using variadic arguments?

func foo(...args: Array) -> Foo:
	return Foo.new(args)
	
class Foo:
   func _init(...args: Array) -> void:
	_values = args	

I use this hack to workaround

func _init(...args: Array) -> void:
	if args.size() == 1 and args[0] is Array:
		_values = args[0]
		return
	_values = args

It would be great instead to write special documentation to support variadic argument delegation over function borders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:manual Issues and PRs related to the Manual/Tutorials section of the documentation cherrypick:4.5 enhancement topic:gdscript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty variadic parameters of functions called in cascade will accumulate empty array elements

4 participants