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

Reflection Baking throws exception if a type contains methods with same name as a method with [Inject]. #85

Open
Monsoonexe opened this issue Apr 10, 2024 · 0 comments

Comments

@Monsoonexe
Copy link

Monsoonexe commented Apr 10, 2024

Describe the bug
The reflection baker fails with a Linq exception (enumeration contains more than one element when using SingleOrDefault) when operating on a type that has a method with the same name as a method with an [Inject] attribute.

To Reproduce
Run baker in Editor with a class like

public class MyClass
{
  public void Init() {}
  
  [Zenject.Inject]
  public void Init(Foo foo){}
}
  • Expected Behavior *
    Duplicate names should not be an issue because the weaver should look up a method by metadata (e.g. signature, attributes) not strictly by name.
  • Zenject version: 9.1.0
  • Unity version: 2019.4.40
  • Project's scripting backend: Mono 4.x
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

No branches or pull requests

1 participant