Skip to content

Make referenced-builder contract checks visibility-aware #313

Description

@igel-devin-ai

Sub-task of #301.

Goal

The contract checks in BuilderScopeResolver.resolveByBuilderContract (ctor(T), B(), build(), and later the factory methods from #309) currently only verify that the members exist. They should additionally verify the members are accessible from the package the generated builder is placed in — e.g. via ProcessingContext.isMemberAccessibleFromBuilderPackage.

Why

Generated consumer code calls the referenced builder's constructor and build() from the generated builder's package. A candidate whose ctor(T), B() or build() is private — or package-private while the generated builder lands in a different package (e.g. via packageName) — passes the contract today but produces uncompilable code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions