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

Generated function class injects dependencies in abstract base class instead of default implementation class #635

Open
SimonCockx opened this issue Sep 4, 2023 · 0 comments
Labels
bug Something isn't working subject: code generation This issue is about code generation

Comments

@SimonCockx
Copy link
Contributor

SimonCockx commented Sep 4, 2023

When one function calls the other, the generated code will contain the injection of its dependencies, e.g.,

@ImplementedBy(Foo.FooDefault.class)
public abstract class Foo implements RosettaFunction {
    @Inject
    protected Bar bar; // its dependency is injected, but never used within the abstract base class.

    public static class FooDefault extends Foo {
        // this class actually uses `bar`, so the injection should happen here.
    }
}

This leads to superfluous injections for custom non-default implementations of Foo, which might not depend on Bar.

@SimonCockx SimonCockx added bug Something isn't working subject: code generation This issue is about code generation labels Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working subject: code generation This issue is about code generation
Projects
None yet
Development

No branches or pull requests

1 participant