blob: 77e6d8569ec93f1a3f66c9b01f33029e89f029ce [file] [log] [blame]
/*
* @test /nodynamiccopyright/
* @bug 8033483
* @summary Should ignore nested lambda bodies during overload resolution
* @compile/fail/ref=IgnoreLambdaBodyDuringResolutionTest1.out -XDrawDiagnostics IgnoreLambdaBodyDuringResolutionTest1.java
*/
class IgnoreLambdaBodyDuringResolutionTest1 {
interface SAM<T> {
T action(T t);
}
<T> T m(SAM<T> op) {
return null;
}
class B {
B x() {
return this;
}
}
class C {}
void foo(B arg) {}
void foo(C arg) {}
void bar() {
foo(m(arg -> new B()));
}
}