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

Source Generator doesn't support inheritance. #753

Open
christallire opened this issue Feb 26, 2025 · 0 comments
Open

Source Generator doesn't support inheritance. #753

christallire opened this issue Feb 26, 2025 · 0 comments

Comments

@christallire
Copy link

I have a class Parent (Assembly A) and Child (Assembly B)
The parent has both Method Injection and Attribute Injection
The Child has nothing to inject.

Source Generator generated following code:

     [Preserve]
     class ChildGeneratedInjector : IInjector
     {

         public object CreateInstance(IObjectResolver resolver, IReadOnlyList<IInjectParameter> parameters)
         {
             var __instance = new Child();
             Inject(__instance, resolver, parameters);
             return __instance;
         }

         public void Inject(object instance, IObjectResolver resolver, IReadOnlyList<IInjectParameter> parameters)
         {
             return;
         }
     }

What I've expected: Inject to Parent class, too.

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