StreamToLoopInspection: disable elements which type is PsiIntersection type or PsiImmediateClassType which is not resolvable in outer context (fixes EA-97901); better diagnostic for cases like EA-97901

This commit is contained in:
Tagir Valeev
2017-03-01 12:37:17 +07:00
parent 3f6a84d808
commit b5e80dfbd8
5 changed files with 46 additions and 6 deletions
@@ -0,0 +1,12 @@
// "Replace Stream API chain with loop" "false"
import java.util.stream.Stream;
public class Test {
interface A {void a();}
interface B {void b();}
public void test(Object obj) {
Stream.of((A & B) obj).fo<caret>rEach(B::b);
}
}
@@ -0,0 +1,9 @@
// "Replace Stream API chain with loop" "false"
import java.util.List;
public class Main {
public void test2(List<? extends CharSequence> list) {
list.stream().map(String::length).for<caret>Each(System.out::println);
}
}