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] @ExtensionMethod methods from parent class are not recognized #3821

Open
iocmet opened this issue Feb 7, 2025 · 0 comments
Open

[BUG] @ExtensionMethod methods from parent class are not recognized #3821

iocmet opened this issue Feb 7, 2025 · 0 comments

Comments

@iocmet
Copy link

iocmet commented Feb 7, 2025

Describe the bug
When trying to call extension method on class that extends extension method target class, compilation will fail, that gonna work only if class is upcasted to its parent

To Reproduce

public class Test {
}
@ExtensionMethod(TestExtensions.class)
public class Test1 extends Test {
    public void test() {
        System.out.println(this.testExtensionMethod()); // Error
        System.out.println(((Test) this).testExtensionMethod()) // No error
    }
}
@UtilityClass
public class TestExtensions {
    public static String testExtensionMethod(Test instance) {
        return "testString";
    }
}

Expected behavior
No error

Version info (please complete the following information):
Lombok vesion: 1.18.36
Platform: Gradle 7.5.1, Java 8

Additional context

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