langtools/test/tools/javac/lambda/T8033483/IgnoreLambdaBodyDuringResolutionTest1.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/T8033483/IgnoreLambdaBodyDuringResolutionTest1.java Wed Jul 09 10:49:32 2014 -0400
@@ -0,0 +1,31 @@
+/*
+ * @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()));
+ }
+}