gumtree-spoon-ast-diff icon indicating copy to clipboard operation
gumtree-spoon-ast-diff copied to clipboard

Diff not being reported for nested lambda function

Open algomaster99 opened this issue 3 years ago • 1 comments

The AST diff in the literal value of return is not being reported.

public class NestedLambda {
    public int iHaveNestedLambda() {
        Function1 f1 = () -> {
            Function2 f2 = () -> {
-                return 42;
+                return 420;
            }
            return f2;
        }
        return f1.lambda1().lambda2();
    }
}

interface Function1 {
    Function2 lambda1();
}

interface Function2 {
    int lambda2();
}

algomaster99 avatar May 14 '22 19:05 algomaster99

That's a serious bug!

monperrus avatar Aug 23 '22 12:08 monperrus

Came back at this and tried to produce a test for it. Turns out, it is working. The diff is being reported. I am not sure what fixed it, but anyway, we can close it.

algomaster99 avatar Oct 20 '22 00:10 algomaster99