forked from uber-go/fx
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix decorator not being applied to transient dependencies (uber-go#941)
There is a bug that only manifests when decorating objects in Fx where transient dependency types are not properly decorated. For example, if type A depends on type B, and type B depends on type C which has a decorator, it fails to recognize that. This only occurs when all constructors and the decorators for all these types are provided at the "root" level fx.App. This happens because fx injects a fake "root" Scope between the actual root Container (which is where constructors are provided to by default). Fixed by making fx stop create this fake root Scope and use the dig.Container directly. Fixes uber-go#940.
- Loading branch information
Showing
2 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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