Failed
org.eclipse.jdt.core.tests.compiler.regression.GenericsRegressionTest_1_8.testBug424415b - 10 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)
Error Message
testBug424415b - Javac found error(s) but Eclipse did not find any. ----------- Expected ------------ ------------ but was ------------ X.java:17: error: incompatible types: inference variable Q has incompatible bounds\n foo(goo(ArrayList<String>::new));\n ^\n upper bounds: String,Collection<?>\n lower bounds: ArrayList<String>\n where Q is a type-variable:\n Q extends Collection<?> declared in method <Q>goo(Functional<Q>)\n Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output\n 1 error\n --------- Difference is ---------- expected:<[]> but was:<[X.java:17: error: incompatible types: inference variable Q has incompatible bounds\n foo(goo(ArrayList<String>::new));\n ^\n upper bounds: String,Collection<?>\n lower bounds: ArrayList<String>\n where Q is a type-variable:\n Q extends Collection<?> declared in method <Q>goo(Functional<Q>)\n Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output\n 1 error\n ]>
Stacktrace
junit.framework.ComparisonFailure: testBug424415b - Javac found error(s) but Eclipse did not find any. ----------- Expected ------------ ------------ but was ------------ X.java:17: error: incompatible types: inference variable Q has incompatible bounds\n foo(goo(ArrayList<String>::new));\n ^\n upper bounds: String,Collection<?>\n lower bounds: ArrayList<String>\n where Q is a type-variable:\n Q extends Collection<?> declared in method <Q>goo(Functional<Q>)\n Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output\n 1 error\n --------- Difference is ---------- expected:<[]> but was:<[X.java:17: error: incompatible types: inference variable Q has incompatible bounds\n foo(goo(ArrayList<String>::new));\n ^\n upper bounds: String,Collection<?>\n lower bounds: ArrayList<String>\n where Q is a type-variable:\n Q extends Collection<?> declared in method <Q>goo(Functional<Q>)\n Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output\n 1 error\n ]> at org.eclipse.jdt.core.tests.compiler.regression.GenericsRegressionTest_1_8.testBug424415b(GenericsRegressionTest_1_8.java:350)
Standard Output
org.eclipse.jdt.core.tests.compiler.regression.GenericsRegressionTest_1_8#testBug424415b - 10 X.java [ import java.util.ArrayList; import java.util.Collection; interface Functional<T> { T apply(); } class X { void foo(Object o) { } void foo(String str) {} <Q extends Collection<?>> Q goo(Functional<Q> s) { return null; } void test() { foo(goo(ArrayList<String>::new)); } } ] Full results sent to /tmp/comptest/run.1584245034298/10.0.2_20200315_040443.txt
Standard Error
--- javac err: --- X.java:17: error: incompatible types: inference variable Q has incompatible bounds foo(goo(ArrayList<String>::new)); ^ upper bounds: String,Collection<?> lower bounds: ArrayList<String> where Q is a type-variable: Q extends Collection<?> declared in method <Q>goo(Functional<Q>) Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error ----------------------------------------