Community
Participate
Working Groups
The following is compiled ok by Eclipse 4.8.0 and Oracle JDK 1.8, but fails to compile in Eclipse 4.9.0: private List<Object> getRowValues(Map<String, BigDecimal> record, Stream<String> factors) { return Stream.concat( factors.map(f -> { if (f.equals("x")) { return record.get(f); } else { return "NM"; } }), Stream.of(BigDecimal.ONE) ) .map(v -> (v instanceof BigDecimal) ? ((BigDecimal) v).setScale(10, BigDecimal.ROUND_HALF_UP) : v) .collect(Collectors.toList()); } Error: Cannot infer type argument(s) for <R> map(Function<? super T,? extends R> The error goes away by either commenting out the second .map call, or by changing either of .map to .<Object>map(...)
Accepted by ecj 4.8, rejected since 4.9 M2, which makes bug 537089 a likely candidate to have broken it. Seeing the ternary in the mix, it is indeed likely that some change relating to intersection types has a finger in the pie. Tentatively putting this on the radar, time permitting.
New Gerrit change created: https://git.eclipse.org/r/136331
(In reply to Eclipse Genie from comment #2) > New Gerrit change created: https://git.eclipse.org/r/136331 Yep, an issue of intersection types, indeed. We had intersection types on both sides of the equation, requiring us to resolve a constraint of the shape Object & Serializable & Comparable<?> <: Object & Serializable & Comparable<?> Method ITB18.isSubtypeOf() wasn't yet up to the task. I borrowed and adjusted code from its isCompatibleWith() and all looks fine for this case.
Gerrit change https://git.eclipse.org/r/136331 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=bcec7451e941decddf86ddcdbe87a1f9b59eec30
(In reply to Eclipse Genie from comment #4) > Gerrit change https://git.eclipse.org/r/136331 was merged to [master]. > Commit: > http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/ > ?id=bcec7451e941decddf86ddcdbe87a1f9b59eec30 In addition to what's said in comment 3 I had to cope with an unrelated(?) failure in ModuleBuilderTests.testBug520147b. Made the test more explicit (about accepting a compile error on the intermediate project p2) and fixed the failure in ModuleDeclaration.analyseModuleGraph() (when checking exported packages, we don't want SplitPackageBindings). Released for 4.11 M3
Verified for Eclipse 4.11 M3 with Build id: I20190218-1800