captured wildcards: don't open unpredictably, treat as type, not type argument (IDEA-148348)

This commit is contained in:
Anna Kozlova
2015-11-26 14:06:32 +01:00
parent f7e9660f0d
commit e43fad4277
12 changed files with 63 additions and 25 deletions

View File

@@ -19,7 +19,7 @@ class Test {
public static <T> BigDecimal add(Collection<T> objectsThatHaveBigDecimals, Function<T, ? extends BigDecimal> functionToGet) {
return objectsThatHaveBigDecimals == null ? null : objectsThatHaveBigDecimals.stream().map(functionToGet).reduce(null, Test::add);
return objectsThatHaveBigDecimals == null ? null : objectsThatHaveBigDecimals.stream().map(functionToGet).reduce(null, <error descr="Bad return type in method reference: cannot convert java.math.BigDecimal to ? extends java.math.BigDecimal">Test::add</error>);
}
public static BigDecimal add(BigDecimal... sequence) {