mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-16 00:14:33 +07:00
[analysis] IDEA-240049 Don't report "foreach not applicable" if type being iterated is unresolved
This patch adds the support of intersection types as requested per the code review Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com> GitOrigin-RevId: eb4f8e42599d402d030b604548d6fd221d9a0448
This commit is contained in:
committed by
intellij-monorepo-bot
parent
33710de3ae
commit
6565d1d76e
+15
@@ -71,4 +71,19 @@ class Main {
|
||||
for (String arg: <error descr="foreach not applicable to type 'Main.Hello'">iterableExistingHello</error>) { }
|
||||
for (String arg: iterableUnresolvedWorld) {}
|
||||
}
|
||||
|
||||
interface A {}
|
||||
interface B {}
|
||||
void test(Object x) {
|
||||
java.util.Optional.of((A & B)x).ifPresent(valueOfAandB -> {
|
||||
for(Object foo : <error descr="foreach not applicable to type 'Main.A & Main.B'">valueOfAandB</error>) {
|
||||
System.out.println(foo);
|
||||
}
|
||||
});
|
||||
java.util.Optional.of((A & <error descr="Cannot resolve symbol 'World'">World</error>)x).ifPresent(valueOfAandUnresolvedWorld -> {
|
||||
for(Object foo : <error descr="foreach not applicable to type 'Main.A & World'">valueOfAandUnresolvedWorld</error>) {
|
||||
System.out.println(foo);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user