Skip to content

Bean implementing generated interface isn't wireable #804

@cbarlin

Description

@cbarlin

Hi there!

Using avaje 11.4, if we have the following setup:

@NonAvajeAnnotation
class MyClassA {}

@Singleton
class MyClassB implements SomeGeneratedInterface {}

@Singleton
class MyClassC {
    public MyClassC (final SomeGeneratedInterface nonAvajeCreatedInterface) {

    }
}

In which the SomeGeneratedInterface is an interface generated by the NonAvajeAnnotation, then the app will fail to compile because avaje-inject cannot find a SomeGeneratedInterface to wire into MyClassC. This occurs even if @BeanTypes({SomeGeneratedInterface.class}) is placed on MyClassB.

Looking at the annotation processing rounds, it appears that avaje-inject correctly delays MyClassC until the end of compilation because it can't find the dependencies, but the MyClassB isn't delayed and a MyClassB$DI is generated immediately without knowledge of SomeGeneratedInterface. Interestingly, I don't get an error about MyClassB not implementing SomeGeneratedInterface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions