Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/IDEA173183.java
Tagir Valeev d8e08c17bb [java-highlighting] Improve error messages around inapplicable method reference
Fixes IDEA-362351 An Incorrect Error warning "Non-static methods cannot be referenced from a static context"
Fixes IDEA-173183 Wrong error message for method reference
Improves IDEA-208532 Incorrect Inspect code error in lambda expression method reference

GitOrigin-RevId: 8f7a17688eaa1aba72bbccd45395967656108668
2024-11-22 15:34:30 +00:00

13 lines
495 B
Java

import java.util.Map;
import java.util.stream.*;
class Either<E>{
public boolean isRight() {
return false;
}
}
class TestClass {
Map<Boolean, Either<String>> test(final Stream<Either<String>> eitherStream) {
return <error descr="Incompatible types. Found: 'java.util.Map<java.lang.Boolean,java.util.List<Either<java.lang.String>>>', required: 'java.util.Map<java.lang.Boolean,Either<java.lang.String>>'">eitherStream.collect(Collectors.groupingBy(Either::isRight));</error>
}
}