Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Handling static lambda calls
- Loading branch information
Jaroslav Tulach
committed
Jul 15, 2021
1 parent
929caa3
commit 8cb5bcad7c8529b88cd40df080550c97e0901e7a
Showing
6 changed files
with
143 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -0,0 +1,38 @@ | ||
| /** | ||
| * Back 2 Browser Bytecode Translator | ||
| * Copyright (C) 2012-2018 Jaroslav Tulach <jaroslav.tulach@apidesign.org> | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, version 2 of the License. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. Look for COPYING file in the top folder. | ||
| * If not, see http://opensource.org/licenses/GPL-2.0. | ||
| */ | ||
| package org.apidesign.bck2brwsr.vm8; | ||
|
|
||
| import org.apidesign.bck2brwsr.vmtest.Compare; | ||
| import org.apidesign.bck2brwsr.vmtest.VMTest; | ||
| import org.testng.annotations.Factory; | ||
|
|
||
| public class SamTest { | ||
|
|
||
| @Compare | ||
| public int staticLambdas() { | ||
| int[] sum = {0}; | ||
| Functions.Compute<Integer> inc = () -> sum[0]++; | ||
| Functions.Compute<Integer> ret = () -> sum[0]; | ||
| inc.get(); | ||
| return ret.get(); | ||
| } | ||
|
|
||
| @Factory public static Object[] create() { | ||
| return VMTest.create(SamTest.class); | ||
| } | ||
| } |