langtools/test/tools/javac/lambda/T8033483/IgnoreLambdaBodyDuringResolutionTest1.java
changeset 25444 27045478cf23
equal deleted inserted replaced
25443:9187d77f2c64 25444:27045478cf23
       
     1 /*
       
     2  * @test /nodynamiccopyright/
       
     3  * @bug 8033483
       
     4  * @summary Should ignore nested lambda bodies during overload resolution
       
     5  * @compile/fail/ref=IgnoreLambdaBodyDuringResolutionTest1.out -XDrawDiagnostics IgnoreLambdaBodyDuringResolutionTest1.java
       
     6  */
       
     7 
       
     8 class IgnoreLambdaBodyDuringResolutionTest1 {
       
     9     interface SAM<T> {
       
    10         T action(T t);
       
    11     }
       
    12 
       
    13     <T> T m(SAM<T> op) {
       
    14         return null;
       
    15     }
       
    16 
       
    17     class B {
       
    18         B x() {
       
    19             return this;
       
    20         }
       
    21     }
       
    22 
       
    23     class C {}
       
    24 
       
    25     void foo(B arg) {}
       
    26     void foo(C arg) {}
       
    27 
       
    28     void bar() {
       
    29         foo(m(arg -> new B()));
       
    30     }
       
    31 }