Skip to content

[BUG] Inner classes delegated with Delegate lose ability to be instantiated externally #4002

@atnak

Description

@atnak

Describe the bug

If an inner class is used as the target of @lombok.experimental.Delegate anywhere, instantiating that class using the outer.new Class() syntax emits a compile error.

To Reproduce

static class Foo {

	class Bar {}
}

static class Delegating {

	@lombok.experimental.Delegate
	Foo.Bar b;
}

public static void main(String[] args) {
	Foo foo = new Foo();
	foo.new Bar(); // Compile error: No enclosing instance of type Foo is accessible
}

Expected behavior

No compile error in the code above

Version info (please complete the following information):

  • Lombok 1.18.42
  • Eclipse 2025-12 (4.38.0)
  • Compiler target: 1.8

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