"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/test/groovy/transform/stc/LambdaTest.groovy" between
apache-groovy-src-3.0.8.zip and apache-groovy-src-3.0.9.zip

About: Groovy is an agile dynamic (scripting) language for the Java Platform. It has features similar to those of Python, Ruby, Perl, and Smalltalk. Source release.

LambdaTest.groovy  (apache-groovy-src-3.0.8):LambdaTest.groovy  (apache-groovy-src-3.0.9)
skipping to change at line 333 skipping to change at line 333
} }
void m2() { void m2() {
Comparator<Integer> y = (a, b) -> Integer.compare(a, b) Comparator<Integer> y = (a, b) -> Integer.compare(a, b)
} }
} }
def t = new T() def t = new T()
assert t.c.compare(0,0) == 0 assert t.c.compare(0,0) == 0
''' '''
} }
@Test // GROOVY-9997
void testComparator3() {
assertScript '''
@groovy.transform.TypeChecked
void test() {
def cast = (Comparator<Integer>) (a, b) -> Integer.compare(a, b)
assert cast.compare(0,0) == 0
def coerce = ((a, b) -> Integer.compare(a, b)) as Comparator<Int
eger>
assert coerce.compare(0,0) == 0
}
test()
'''
}
@Test @Test
void testFunctionWithLocalVariables() { void testFunctionWithLocalVariables() {
assertScript ''' assertScript '''
import groovy.transform.CompileStatic import groovy.transform.CompileStatic
import java.util.stream.Collectors import java.util.stream.Collectors
import java.util.stream.Stream import java.util.stream.Stream
@CompileStatic @CompileStatic
public class Test1 { public class Test1 {
public static void main(String[] args) { public static void main(String[] args) {
 End of changes. 1 change blocks. 
0 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)