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

Control cyclic generator dependencies #28

Open
Nirei opened this issue May 16, 2021 · 0 comments
Open

Control cyclic generator dependencies #28

Nirei opened this issue May 16, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Nirei
Copy link
Collaborator

Nirei commented May 16, 2021

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.

@Nirei Nirei added the enhancement New feature or request label May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant