File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -365,10 +365,19 @@ class MultiBindProvider(ListOfProviders[List[T]]):
365365 def get (self , injector : 'Injector' ) -> List [T ]:
366366 result : List [T ] = []
367367 for binding in self ._multi_bindings :
368- scope_binding , _ = self ._binder .get_binding (binding .scope )
368+ if (
369+ isinstance (binding .provider , ClassProvider )
370+ and binding .scope is NoScope
371+ and self ._binder .parent
372+ and self ._binder .parent .has_explicit_binding_for (binding .provider ._cls )
373+ ):
374+ parent_binding , _ = self ._binder .parent .get_binding (binding .provider ._cls )
375+ scope_binding , _ = self ._binder .parent .get_binding (parent_binding .scope )
376+ else :
377+ scope_binding , _ = self ._binder .get_binding (binding .scope )
369378 scope_instance : Scope = scope_binding .provider .get (injector )
370379 provider_instance = scope_instance .get (binding .interface , binding .provider )
371- instances : List [ T ] = _ensure_iterable (provider_instance .get (injector ))
380+ instances = _ensure_iterable (provider_instance .get (injector ))
372381 result .extend (instances )
373382 return result
374383
You can’t perform that action at this time.
0 commit comments