|
Lines 6847-6855
Link Here
|
| 6847 |
null /* no extra class libraries */, |
6847 |
null /* no extra class libraries */, |
| 6848 |
true /* flush output directory */, |
6848 |
true /* flush output directory */, |
| 6849 |
null /* custom options */ |
6849 |
null /* custom options */ |
| 6850 |
); |
6850 |
); |
| 6851 |
} |
6851 |
} |
|
|
6852 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=412650 |
| 6853 |
// [1.8][compiler]Incongruent Lambda Exception thrown |
| 6854 |
public void test412650() { |
| 6855 |
this.runNegativeTest( |
| 6856 |
new String[] { |
| 6857 |
"X.java", |
| 6858 |
"package test;\n" + |
| 6859 |
"import static test.Y.*;\n" + |
| 6860 |
"public class X {\n" + |
| 6861 |
" public void foo() {\n" + |
| 6862 |
" Y<String> generated = cons(\"a\", () -> cons(\"b\", Y::<String>empty));\n" + |
| 6863 |
" }\n" + |
| 6864 |
"}\n", |
| 6865 |
"Y.java", |
| 6866 |
"package test;\n" + |
| 6867 |
"import java.util.function.Supplier;\n" + |
| 6868 |
"public abstract class Y<E> {\n" + |
| 6869 |
" public static <E> Y<E> empty() { return null;}\n" + |
| 6870 |
" public static <E> Y<E> cons(E head, Supplier<Y<E>> tailFun) {return null;}\n" + |
| 6871 |
"}\n" |
| 6872 |
}, |
| 6873 |
"----------\n" + |
| 6874 |
"1. ERROR in X.java (at line 5)\n" + |
| 6875 |
" Y<String> generated = cons(\"a\", () -> cons(\"b\", Y::<String>empty));\n" + |
| 6876 |
" ^^^^^^^^^^^^^^^^\n" + |
| 6877 |
"The type of empty() from the type Y is Y<Object>, this is incompatible with the descriptor's return type: Y<E>\n" + |
| 6878 |
"----------\n", |
| 6879 |
null /* no extra class libraries */, |
| 6880 |
true /* flush output directory */, |
| 6881 |
null /* custom options */ |
| 6882 |
); |
| 6883 |
} |
| 6852 |
public static Class testClass() { |
6884 |
public static Class testClass() { |
| 6853 |
return NegativeLambdaExpressionsTest.class; |
6885 |
return NegativeLambdaExpressionsTest.class; |
| 6854 |
} |
6886 |
} |
| 6855 |
} |
6887 |
} |