|
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 |
"interface I {\n" + |
| 6859 |
" String sam();\n" + |
| 6860 |
"}\n" + |
| 6861 |
"public class X {\n" + |
| 6862 |
" static String foo(I i) { return \"\"; }\n" + |
| 6863 |
" public static void main(String[] args) {\n" + |
| 6864 |
" foo(() -> foo(X::getInt));\n" + |
| 6865 |
" }\n" + |
| 6866 |
" static Integer getInt() { return 0; }\n" + |
| 6867 |
"}\n" |
| 6868 |
}, |
| 6869 |
"----------\n" + |
| 6870 |
"1. ERROR in X.java (at line 7)\n" + |
| 6871 |
" foo(() -> foo(X::getInt));\n" + |
| 6872 |
" ^^^^^^^^^\n" + |
| 6873 |
"The type of getInt() from the type X is Integer, this is incompatible with the descriptor's return type: String\n" + |
| 6874 |
"----------\n", |
| 6875 |
null /* no extra class libraries */, |
| 6876 |
true /* flush output directory */, |
| 6877 |
null /* custom options */ |
| 6878 |
); |
| 6879 |
} |
| 6852 |
public static Class testClass() { |
6880 |
public static Class testClass() { |
| 6853 |
return NegativeLambdaExpressionsTest.class; |
6881 |
return NegativeLambdaExpressionsTest.class; |
| 6854 |
} |
6882 |
} |
| 6855 |
} |
6883 |
} |