Commits

Tim Vernum committed 96213bb

Add func test for nested lambdas

Comments (0)

Files changed (2)

convert/source/resource/test/functional/005-NestedLambda.java

+package foo;
+
+import java.util.concurrent.Callable;
+
+public class Outer {
+
+  public class Inner {
+
+    public Callable<Runnable> getLauncher() {
+      int i = -1;
+      Callable<Runnable> c = () -> {
+        int j = 9;
+        Runnable r = () -> { foo(i,j); };
+        return r;
+      };
+
+      return c;
+    }
+
+  }
+
+  public void foo(int i, int j) { }
+
+}

convert/source/resource/test/functional/005-NestedLambda.java.convert

+package foo;
+import java.util.concurrent.Callable;
+public class Outer {
+  public class Inner {
+    public Callable<Runnable> getLauncher() {
+      final int i = -1;
+      Callable<Runnable> c = new Callable<Runnable>() {
+        public Runnable call() throws java.lang.Exception {
+          final int j = 9;
+          Runnable r = new Runnable() {
+            public void run() {
+              foo(i, j);
+            }
+          }
+;
+          return r;
+        }
+      }
+;
+      return c;
+    }
+  }
+public void foo(int i, int j) {
+  }
+}