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

Buildable types don't get setters accepting Builders when Builder is package private #230

Open
aabdagic opened this issue Jan 3, 2017 · 0 comments
Labels

Comments

@aabdagic
Copy link

aabdagic commented Jan 3, 2017

When not part of the same package, that's necessary to avoid compile time errors, but here they are part of the same package. Note that I tested this on a composed @FreeBuilder type, not on other buildable types.

For example, this won't work because setNested2 doesn't have a overload that accepts a Nested2.Builder.

public class Foo {

  void test() {
    new Nested1.Builder().setNested2(new Nested2.Builder());
  }

  @FreeBuilder
  abstract static class Nested1 {
    abstract Nested2 getNested2();
    static class Builder extends Foo_Nested1_Builder {}
  }

  @FreeBuilder
  abstract static class Nested2 {
    static class Builder extends Foo_Nested2_Builder {}
  }
}

But if make Nested2.Builder public, even without making Nested2 public, i.e.

  @FreeBuilder
  abstract static class Nested2 {
    public static class Builder extends Foo_Nested2_Builder {}
  }

the setter is generated.

@alicederyn alicederyn reopened this Jan 4, 2017
@alicederyn alicederyn added the bug label Feb 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants