mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
MethodReturnTypeFix: highlight only return statements when method return type doesn't match expected (IDEA-216275)
GitOrigin-RevId: d5f7dc3b03d68d249ba29532b0e8c0555cae60d6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ba328fd25a
commit
642c65dd11
@@ -6,7 +6,7 @@ class Test {
|
||||
return list.stream().flatMap(List::stream).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private static List<Object> <error descr="Invalid return type">test1</error>(List<List> list) {
|
||||
private static List<Object> test1(List<List> list) {
|
||||
<error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.util.List<java.lang.Object>'">return list.stream().flatMap(l -> l.stream()).collect(Collectors.toList());</error>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ConcurrentCollectors {
|
||||
}
|
||||
|
||||
static class Test3 {
|
||||
static <T, K, D, M1 extends Map<K, D>> C<T, M1> <error descr="Invalid return type">groupingBy</error>(F<M1> f,
|
||||
static <T, K, D, M1 extends Map<K, D>> C<T, M1> groupingBy(F<M1> f,
|
||||
C<T, D> c,
|
||||
BiConsumer<M1, T> consumer) {
|
||||
return new CImpl<error descr="Cannot infer arguments"><></error>(f, consumer, arg(c.getOp()));
|
||||
|
||||
@@ -11,7 +11,7 @@ interface Foo<T> {
|
||||
}
|
||||
|
||||
class Bar {
|
||||
Foo<List<String>> <error descr="Invalid return type">transform</error>(final Foo<? extends String> foo) {
|
||||
Foo<List<String>> transform(final Foo<? extends String> foo) {
|
||||
<error descr="Incompatible types. Found: 'Foo<? extends java.util.List<? extends java.lang.String>>', required: 'Foo<java.util.List<java.lang.String>>'">return foo
|
||||
.map(v2 -> tuple(v2))
|
||||
.onClose();</error>
|
||||
|
||||
@@ -3,7 +3,7 @@ import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
class MyTest {
|
||||
static Map<String, Meeting> <error descr="Invalid return type">getMeetingsById</error>(List<Meeting> meetings){
|
||||
static Map<String, Meeting> getMeetingsById(List<Meeting> meetings){
|
||||
return <error descr="Incompatible types. Found: 'java.util.Map<java.lang.String,java.util.List<Meeting>>', required: 'java.util.Map<java.lang.String,Meeting>'">meetings.stream()
|
||||
.collect(Collectors.groupingBy(Meeting::getId));</error>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user