Skip to content
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

feat(di): nested impl traits #31

Merged
merged 10 commits into from
Sep 24, 2024
Merged

feat(di): nested impl traits #31

merged 10 commits into from
Sep 24, 2024

Conversation

chesedo
Copy link
Owner

@chesedo chesedo commented Sep 24, 2024

Handles nested impl Traits correctly as seen by the newly added example. Without these changes the example does not compile.

Sometimes an `impl Trait` can be more than one level of generics deep.
Or it might come from more than just the immediate children. This PR
handles these cases correctly.

It also expands the child dependency explicitly rather than calling a
function to get the child dependencies. This is needed to prevent
premature casting to `impl` types which leads to a compile error.
This makes more complex possible as shown by the new example.
This means adding support to understand the concrete type of transient
dependencies. This is needed if any parent dependency of a transient is
managed by the container.
We already know this is a box so no need for a helper function.
@chesedo chesedo merged commit 9404817 into main Sep 24, 2024
3 checks passed
@chesedo chesedo deleted the feat/nested_impl_traits branch September 24, 2024 13:57
@chesedo chesedo mentioned this pull request Sep 24, 2024
@chesedo chesedo mentioned this pull request Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant