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] lombok.val causes compilation failure when used with default implementation of an interface method #3242

Closed
phommy opened this issue Aug 10, 2022 · 0 comments · Fixed by #3288

Comments

@phommy
Copy link

phommy commented Aug 10, 2022

Describe the bug
"mvn clean compile" will throw an error if, in a method, there is both a variable declared with lombok.val and a call to the default implementation of a interface

To Reproduce

package com.example;

import lombok.val;

public class class1 implements interface1 {
    void method1() {
        // If you comment any of the following two lines, the project compiles normally.
        // Otherwise, "mvn clean compile" will report the following error:
        // Compilation failure
        // Lombok visitor handler class lombok.javac.handlers.HandleVal failed:
        // java.lang.AssertionError

        val string1 = "s";
        interface1.super.defaultMethod();
    }
}

public interface interface1 {
    default void defaultMethod() {
    }
}

demo.zip

Expected behavior
Successful build.

Version info:

  • Lombok 1.18.24 (maven)
  • maven.compiler.source 1.8
  • maven.compiler.target 1.8
@phommy phommy changed the title [BUG] lombok.val causes compilation failure when used with default implementation of a interface [BUG] lombok.val causes compilation failure when used with default implementation of an interface method Aug 10, 2022
Rawi01 added a commit to Rawi01/lombok that referenced this issue Oct 30, 2022
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

Successfully merging a pull request may close this issue.

1 participant