Skip to content

Commit 07100a8

Browse files
committed
Changed FromComponentsInHierarchy to require scope set
1 parent fc9696b commit 07100a8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

UnityProject/Assets/Plugins/Zenject/OptionalExtras/IntegrationTests/Tests/Bindings/TestFromComponentInHierarchy/TestFromComponentInHierarchy.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public IEnumerator RunMatchMultiple()
5858
Setup1();
5959
PreInstall();
6060
Container.Bind<Qux>().AsSingle();
61-
Container.Bind<Foo>().FromComponentsInHierarchy();
61+
Container.Bind<Foo>().FromComponentsInHierarchy().AsCached();
6262

6363
PostInstall();
6464

@@ -88,7 +88,7 @@ public IEnumerator RunMatchNotFoundSuccess()
8888
PreInstall();
8989

9090
Container.Bind<Qux>().AsSingle().NonLazy();
91-
Container.Bind<Foo>().FromComponentsInHierarchy();
91+
Container.Bind<Foo>().FromComponentsInHierarchy().AsCached();
9292

9393
PostInstall();
9494

@@ -134,7 +134,7 @@ public IEnumerator RunMatchMultipleNonGeneric()
134134
Setup1();
135135
PreInstall();
136136
Container.Bind<Qux>().AsSingle();
137-
Container.Bind(typeof(Foo)).FromComponentsInHierarchy();
137+
Container.Bind(typeof(Foo)).FromComponentsInHierarchy().AsCached();
138138

139139
PostInstall();
140140

@@ -164,7 +164,7 @@ public IEnumerator RunMatchNotFoundSuccessNonGeneric()
164164
PreInstall();
165165

166166
Container.Bind<Qux>().AsSingle().NonLazy();
167-
Container.Bind(typeof(Foo)).FromComponentsInHierarchy();
167+
Container.Bind(typeof(Foo)).FromComponentsInHierarchy().AsCached();
168168

169169
PostInstall();
170170

UnityProject/Assets/Plugins/Zenject/Source/Binding/Binders/FromBinders/FromBinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ protected ScopeConcreteIdArgConditionCopyNonLazyBinder FromComponentsInHierarchy
747747
{
748748
BindingUtil.AssertIsInterfaceOrComponent(AllParentTypes);
749749

750-
BindInfo.RequireExplicitScope = false;
750+
BindInfo.RequireExplicitScope = true;
751751

752752
// Don't know how it's created so can't assume here that it violates AsSingle
753753
BindInfo.MarkAsCreationBinding = false;

0 commit comments

Comments
 (0)