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

[BUG] @Delegate throws error on interface methods in javac #3753

Open
nlisker opened this issue Sep 23, 2024 · 0 comments
Open

[BUG] @Delegate throws error on interface methods in javac #3753

nlisker opened this issue Sep 23, 2024 · 0 comments

Comments

@nlisker
Copy link

nlisker commented Sep 23, 2024

public interface DelegateInterface {

	@Delegate // line 7
	Inner getInner();
}

interface Inner {

	int getCode();
}

Compiles in Eclipse, but with javac it gives the error:

DelegateInterface.java:7: error: interface abstract methods cannot have body
	@Delegate
	^
1 error

Perhaps default was not added to the generated methods? If I understand @Delegate correctly, I expect the following after delombok:

public interface DelegateInterface {

	@Delegate
	Inner getInner();

	default int getCode() {
		return getInner().getCode();
	}
}

Lombok 1.18.34
Java 22
Eclipse 4.32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant