google / google/fruit

Allow injection of multibinding providers

Open
#51 2 comments 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
1.9k
Forks
202
PR merge metrics
No merged PRs in 30d

Description

E.g. we could define a `fruit::MultibindingProvider` class that allows to get a vector of the multibindings for that type, and allow injecting that as a dependency.
This will have the caveat that injection dependency loops involving a `MultibindingProvider` will only be detected at runtime.

To print the actual loop, maybe we can have an on-this-error-only, slow code path where we walk the injection graph at runtime, looking for in-progress injections, to find the loop; then we can print a more useful error message with the types involved in the loop. TBD if there's enough information available to determine the loop.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.