Skip to content

Allow bsn caching syntax for zero-argument function calls#24443

Open
laundmo wants to merge 1 commit into
bevyengine:mainfrom
laundmo:bsn-allow-cached-call-syntax
Open

Allow bsn caching syntax for zero-argument function calls#24443
laundmo wants to merge 1 commit into
bevyengine:mainfrom
laundmo:bsn-allow-cached-call-syntax

Conversation

@laundmo
Copy link
Copy Markdown
Contributor

@laundmo laundmo commented May 25, 2026

Objective

In #24367 the caching syntax using the : prefix was limited to only being allowed in front of scene functions without arguments. The way this check was implemented meant the following was not valid: :scene() even tho :scene is converted to scene() in the macro anyways. Theres an argument for disallowing () call syntax from the start, to make it obvious whats going on, but at least when working in the context of the Rust macro, a function name being converted to a function call seems unintuitive.

Solution

Change the check used to allow zero-argument :scene() calls as well as :scene auto-called functions.

Testing

  • cargo test --lib bevy_scene
  • cargo run --example feathers_gallery --features=bevy_feathers

@laundmo laundmo added A-Scenes Composing and serializing ECS objects D-Straightforward Simple bug fixes and API improvements, docs, test and examples C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Design This issue requires design work to think about how it would best be accomplished labels May 25, 2026
@laundmo
Copy link
Copy Markdown
Contributor Author

laundmo commented May 25, 2026

Needs-Design for the open question of whether we even want to allow this

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

Labels

A-Scenes Composing and serializing ECS objects C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Design This issue requires design work to think about how it would best be accomplished

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant