Skip to content

Control cyclic generator dependencies #28

@Nirei

Description

@Nirei

Currently two generators can be declared such as:

@Generator
public interface AGenerator {
    default A generate(B b) {
        return new A(b);
    }
}

@Generator
public interface BGenerator {
    default B generate(A a) {
        return new B(a);
    }
}

Creation of such generators will, at best, result in a StackOverflowException.

Precautions should be taken to prevent this situations at compile time and force users to modify such paradoxical declarations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions