Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WithArguments doesn't work with IFactory bindings including Components #196

Open
sbergen opened this issue Nov 6, 2020 · 0 comments · Fixed by #197
Open

WithArguments doesn't work with IFactory bindings including Components #196

sbergen opened this issue Nov 6, 2020 · 0 comments · Fixed by #197

Comments

@sbergen
Copy link

sbergen commented Nov 6, 2020

Using

Container.BindIFactory<T>()
        .From[New]ComponentOn...()
        .WithArguments(val);

will not properly inject the value(s) provided in WithArguments

To Reproduce

Declare a binding like

Container.BindIFactory<IFoo>()
    .To<Foo>()
    .FromNewComponentOnNewGameObject()
    .WithArguments(someValue);

where Foo needs an instance of the type of someValue, which is not already bound.

Expected behavior

Binding works as expected, and someValue gets injected into the Foo instance

Actual behavior

When resolving Foo it says the type of someValue can not be resolved.

Extenject and Unity info (please complete the following information):

  • Zenject version: f3a0883
  • Unity version: 2019.4.11f1
  • Project's scripting backend: Mono & IL2CPP

Additional context
Pull Request coming up in a minute :)

@sbergen sbergen changed the title WithArguments doesn't work with IFactory bindings WithArguments doesn't work with IFactory bindings including Components Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant