Skip to content

Failed

org.eclipse.jdt.core.tests.compiler.regression.LambdaExpressionsTest.test437781 - 1.8 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)

Failing for the past 4 builds (Since #6 )
Took 0.71 sec.

Error Message

test437781 - Javac found error(s) but Eclipse did not find any.
----------- Expected ------------

------------ but was ------------
X.java:5: error: reference to visit is ambiguous\n
  new X().visit( System.out::println );\n
         ^\n
  both method visit(Function<Integer,Boolean>) in X and method visit(Consumer<Integer>) in X match\n
X.java:5: error: incompatible types: bad return type in method reference\n
  new X().visit( System.out::println );\n
                 ^\n
    void cannot be converted to Boolean\n
X.java:7: warning: [overloads] visit(Function<Integer,Boolean>) in X is potentially ambiguous with visit(Consumer<Integer>) in X\n
 public boolean visit(Function<Integer, Boolean> func) {\n
                ^\n
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output\n
2 errors\n
1 warning\n

--------- Difference is ----------
 expected:<[]> but was:<[X.java:5: error: reference to visit is ambiguous\n
  new X().visit( System.out::println );\n
         ^\n
  both method visit(Function<Integer,Boolean>) in X and method visit(Consumer<Integer>) in X match\n
X.java:5: error: incompatible types: bad return type in method reference\n
  new X().visit( System.out::println );\n
                 ^\n
    void cannot be converted to Boolean\n
X.java:7: warning: [overloads] visit(Function<Integer,Boolean>) in X is potentially ambiguous with visit(Consumer<Integer>) in X\n
 public boolean visit(Function<Integer, Boolean> func) {\n
                ^\n
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output\n
2 errors\n
1 warning\n
]>

Stacktrace

junit.framework.ComparisonFailure: test437781 - Javac found error(s) but Eclipse did not find any.
----------- Expected ------------

------------ but was ------------
X.java:5: error: reference to visit is ambiguous\n
		new X().visit( System.out::println );\n
		       ^\n
  both method visit(Function<Integer,Boolean>) in X and method visit(Consumer<Integer>) in X match\n
X.java:5: error: incompatible types: bad return type in method reference\n
		new X().visit( System.out::println );\n
		               ^\n
    void cannot be converted to Boolean\n
X.java:7: warning: [overloads] visit(Function<Integer,Boolean>) in X is potentially ambiguous with visit(Consumer<Integer>) in X\n
	public boolean visit(Function<Integer, Boolean> func) {\n
	               ^\n
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output\n
2 errors\n
1 warning\n

--------- Difference is ----------
 expected:<[]> but was:<[X.java:5: error: reference to visit is ambiguous\n
		new X().visit( System.out::println );\n
		       ^\n
  both method visit(Function<Integer,Boolean>) in X and method visit(Consumer<Integer>) in X match\n
X.java:5: error: incompatible types: bad return type in method reference\n
		new X().visit( System.out::println );\n
		               ^\n
    void cannot be converted to Boolean\n
X.java:7: warning: [overloads] visit(Function<Integer,Boolean>) in X is potentially ambiguous with visit(Consumer<Integer>) in X\n
	public boolean visit(Function<Integer, Boolean> func) {\n
	               ^\n
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output\n
2 errors\n
1 warning\n
]>
	at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(TestCase.java:260)
	at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(TestCase.java:236)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runJavac(AbstractRegressionTest.java:2052)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runTest(AbstractRegressionTest.java:2814)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runTest(AbstractRegressionTest.java:2539)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runConformTest(AbstractRegressionTest.java:1396)
	at org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runConformTest(AbstractRegressionTest.java:1393)
	at org.eclipse.jdt.core.tests.compiler.regression.LambdaExpressionsTest.test437781(LambdaExpressionsTest.java:4661)

Standard Output

org.eclipse.jdt.core.tests.compiler.regression.LambdaExpressionsTest#test437781 - 1.8
X.java [
import java.util.function.Consumer;
import java.util.function.Function;
public class X {
	public static void main(String[] args) {
		new X().visit( System.out::println );
	}
	public boolean visit(Function<Integer, Boolean> func) {
		System.out.println("Function");
		return true;
	}
	public void visit(Consumer<Integer> func) {
		System.out.println("Consumer");
	}	
}

]


Full results sent to /tmp/comptest/run.1514610271420/1.8.0_131_20171230_000432.txt

Standard Error

--- javac err: ---
X.java:5: error: reference to visit is ambiguous
		new X().visit( System.out::println );
		       ^
  both method visit(Function<Integer,Boolean>) in X and method visit(Consumer<Integer>) in X match
X.java:5: error: incompatible types: bad return type in method reference
		new X().visit( System.out::println );
		               ^
    void cannot be converted to Boolean
X.java:7: warning: [overloads] visit(Function<Integer,Boolean>) in X is potentially ambiguous with visit(Consumer<Integer>) in X
	public boolean visit(Function<Integer, Boolean> func) {
	               ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
1 warning

----------------------------------------