langtools/test/tools/javac/lambda/LambdaExpr15.java
changeset 18662 1cac45e71eb9
parent 15569 399c4ef97e3c
child 22448 a85fbad9d687
equal deleted inserted replaced
18661:9dedda2ba49a 18662:1cac45e71eb9
    46         //anon class
    46         //anon class
    47         Block<Object> ba1 = t -> {
    47         Block<Object> ba1 = t -> {
    48             new Object() {
    48             new Object() {
    49                 String get() { return ""; }
    49                 String get() { return ""; }
    50             };
    50             };
    51             assertTrue(t == 1);
    51             assertTrue((Integer)t == 1);
    52         };
    52         };
    53         ba1.apply(1);
    53         ba1.apply(1);
    54 
    54 
    55         //local class
    55         //local class
    56         Block<Object> ba2 = t -> {
    56         Block<Object> ba2 = t -> {
    57             class A {
    57             class A {
    58                 String get() { return ""; }
    58                 String get() { return ""; }
    59             };
    59             };
    60             new A();
    60             new A();
    61             assertTrue(t == 2);
    61             assertTrue((Integer)t == 2);
    62         };
    62         };
    63         ba2.apply(2);
    63         ba2.apply(2);
    64         assertTrue(assertionCount == 2);
    64         assertTrue(assertionCount == 2);
    65     }
    65     }
    66 }
    66 }