Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants