Fix: Add turbofish support to bsn!#25054
Open
Tatsuya0330 wants to merge 3 commits into
Open
Conversation
alice-i-cecile
requested review from
cart and
laundmo
and removed request for
cart
July 18, 2026 17:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
bsn!#24962Background
bsn!with turbofish syntax, the generic type arguments were completely omitted upon macro expansion.TemplateConstructorandFromTemplateConstructordid not possess any variables or fields designated to receive and output those type arguments.Solution
crates/bevy_scene/macros/src/bsn/types.rspub function_generics: Option<syn::AngleBracketedGenericArguments>field to theBsnConstructorstruct.crates/bevy_scene/macros/src/bsn/parse.rstake_last_path_identand introduced a new function.take_last_path_segment: which retrieves asyn::PathSegmentcontaining both the identifier and the arguments.PathType::TypeFunction, the generic arguments enclosed in angle brackets following the method name are now extracted.function_generics, withinBsnConstructor.crates/bevy_scene/macros/src/bsn/codegen.rsfunction_genericsas a turbofish immediately after the method name during token generation forTemplateConstructorandFromTemplateConstructor.Testing
Added unit test
TemplateConstructorandFromTemplateConstructor.