Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2019-02-05 21:31:28 +0000
committerStephan Herrmann2019-02-06 23:49:39 +0000
commitbcec7451e941decddf86ddcdbe87a1f9b59eec30 (patch)
treec6b3926ba2cfe7408a283b65d8e573a46ec8da9a /org.eclipse.jdt.core.tests.compiler/src
parentf4c214a7a3a283cd92dfa31f14ee2ca73595fb7b (diff)
downloadeclipse.jdt.core-bcec7451e941decddf86ddcdbe87a1f9b59eec30.tar.gz
eclipse.jdt.core-bcec7451e941decddf86ddcdbe87a1f9b59eec30.tar.xz
eclipse.jdt.core-bcec7451e941decddf86ddcdbe87a1f9b59eec30.zip
Bug 540846 - [regression] Cannot infer type argument(s) for <R>
map(Function<? super T,? extends R> Change-Id: I340a5e402d319615f21623cd6492ba4037078bd4 Signed-off-by: Stephan Herrmann <stephan.herrmann@berlin.de>
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler/src')
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
index 1979b4bbdd..4bf0b94b6e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
@@ -9485,4 +9485,31 @@ public void testBug508834_comment0() {
};
runner.runConformTest();
}
+ public void testBug540846() {
+ Runner runner = new Runner();
+ runner.testFiles = new String[] {
+ "Test.java",
+ "import java.util.*;\n" +
+ "import java.util.stream.*;\n" +
+ "import java.math.*;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " private List<Object> getRowValues(Map<String, BigDecimal> record, Stream<String> factors) {\n" +
+ " return Stream.concat(\n" +
+ " factors.map(f -> {\n" +
+ " if (f.equals(\"x\")) {\n" +
+ " return record.get(f);\n" +
+ " } else {\n" +
+ " return \"NM\";\n" +
+ " }\n" +
+ " }),\n" +
+ " Stream.of(BigDecimal.ONE)\n" +
+ " )\n" +
+ " .map(v -> (v instanceof BigDecimal) ? ((BigDecimal) v).setScale(10, BigDecimal.ROUND_HALF_UP) : v)\n" +
+ " .collect(Collectors.toList());\n" +
+ " }\n" +
+ "}\n"
+ };
+ runner.runConformTest();
+ }
}

Back to the top