Skip to content

Conversation

@Bromeon
Copy link
Member

@Bromeon Bromeon commented Aug 7, 2024

With the recent addition of #[init(node = ...)] syntax for OnReady node paths (#807), we now have multiple possible keys for the #[init] attribute.

Since "value" is a better differentiator to "node" and possibly other future additions, this is now renamed. val also makes the syntax reasonably short, being the most common occurrence. "Default" is a bad name because even node represents a default value, it just expands to a more complex expression. The commonality is that everything used as a field initializer inside init(), which is expressed by #[init] already.

The old syntax has been deprecated and will remain working throughout v0.2. A warning is emitted if it is used.

@Bromeon Bromeon added quality-of-life No new functionality, but improves ergonomics/internals c: register Register classes, functions and other symbols to GDScript labels Aug 7, 2024
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-844

@godot-rust godot-rust deleted a comment from GodotRust Aug 7, 2024
@Bromeon Bromeon added this pull request to the merge queue Aug 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 8, 2024
@Bromeon Bromeon added this pull request to the merge queue Aug 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 8, 2024
@Bromeon Bromeon added this pull request to the merge queue Aug 8, 2024
Merged via the queue into master with commit 128c7ce Aug 8, 2024
@Bromeon Bromeon deleted the qol/init-val branch August 8, 2024 22:02
ColinWttt added a commit to ColinWttt/book that referenced this pull request Feb 2, 2025
The attribute key #[init(val = ...)] replaces #[init(default = ...)].
More information on godot-rust/gdext#844
Bromeon pushed a commit to godot-rust/book that referenced this pull request Feb 2, 2025
#73)

The attribute key #[init(val = ...)] replaces #[init(default = ...)].
More information on godot-rust/gdext#844
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: register Register classes, functions and other symbols to GDScript quality-of-life No new functionality, but improves ergonomics/internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants