Repository: reagento/dishka

Issue:
Unable to use provide_all with WithParents
Attempting to use provide_all with WithParents results in a `TypeError: Cannot use <class 'dishka.entities.provides_marker.ProvideMultiple'> as a factory.`

Example code:

```python
from abc import abstractmethod
from typing import Protocol

from dishka import Provider, Scope, WithParents, provide_all


class MyProtocol(Protocol):
    @abstractmethod
    def __call__(self, data: bytes) -> bytes: ...


class MyImpl(MyProtocol):
    def __call__(self, data: bytes) -> bytes: ...


class MyProvider(Provider):
    scope = Scope.REQUEST

    interactors = provide_all(WithParents[MyImpl])
```

Discussion:

Patch:
diff --git a/src/dishka/dependency_source/make_factory.py b/src/dishka/dependency_source/make_factory.py
index d5a97cc..deb7280 100644
--- a/src/dishka/dependency_source/make_factory.py
+++ b/src/dishka/dependency_source/make_factory.py
@@ -433,6 +433,11 @@ def make_factory(
         is_in_class: bool,
         override: bool,
 ) -> Factory:
+    if get_origin(source) is ProvideMultiple:
+        if provides is None:
+            provides = source
+        source = get_args(source)[0]
+
     if is_bare_generic(source):
         source = source[get_type_vars(source)]  # type: ignore[index]
 


Test patch:
diff --git a/tests/unit/container/test_alias.py b/tests/unit/container/test_alias.py
index 1c69f61..1fdb615 100644
--- a/tests/unit/container/test_alias.py
+++ b/tests/unit/container/test_alias.py
@@ -67,6 +67,24 @@ def test_implicit():
     mock.assert_called_once()
 
 
+
+def test_implicit_no_source():
+    provider = Provider(scope=Scope.APP)
+    provider.provide_all(AnyOf[float, str])
+    container = make_container(provider)
+    assert container.get(float) == 0.0
+    assert container.get(str) == 0.0
+
+
+
+def test_implicit_all():
+    provider = Provider(scope=Scope.APP)
+    provider.provide_all(AnyOf[float, str])
+    container = make_container(provider)
+    assert container.get(float) == 0.0
+    assert container.get(str) == 0.0
+
+
 def test_implicit_generator():
     class MyProvider(Provider):
         value = 0