-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix require components depth #19976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix require components depth #19976
Conversation
Putting this into draft mode since after a bit more analysis this seems to be the wrong order (it's breath-first-like/lower-inheritance-depth-preferred but should be depth-first instead) |
Good catch. We should add more tests to ensure that this is caught. |
The issue is that we also have features that assume a breath-first-like/lower-inheritance-depth-preferred order, and we have tests for them too |
Note: I suggest reviewing commit-by-commit
Objective
RequiredComponent.inheritance_depth
docs do not matchComponent
derive impl #19863Solution
requiree
,inheritance_depth
andrecursion_check_stack
parameters fromComponent::register_required_components
requiree
was effectively unusedinheritance_depth
is now useless, because the depth is always either 0 (for direct requirements) or computed inregister_inherited_required_components
by bumping the depth of the inherited componentsrecursion_check_stack
has been moved toComponentsRegistrator
, which also allows to makeenforce_no_required_components_recursion
private.Testing
RequiredComponent.inheritance_depth
docs do not matchComponent
derive impl #19863