这是indexloc提供的服务,不要输入任何密码
Skip to content

[BUG] lombok.val causes compilation failure when used with default implementation of an interface method #3242

@phommy

Description

@phommy

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

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