[java inference] treat intersection type in one more place (IDEA-274350)

GitOrigin-RevId: d31b30aab900748010f28b02c483c56982d26040
This commit is contained in:
Anna Kozlova
2021-07-26 12:17:41 +02:00
committed by intellij-monorepo-bot
parent 41f79ea01a
commit 07fe5de1ce
3 changed files with 36 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
import java.io.Serializable;
import java.util.function.Function;
class Test {
@@ -33,3 +34,17 @@ class Test1 {
Object c0 = (A & B) ()->{};
}
}
class Test2 {
{
foo(i -> i);
foo1(i -> i);
foo2(i -> i);
}
private static <T extends Function<?, ?> & A<?>> void foo(T t) { }
private static <T extends Function<?, ?> & Serializable> void foo1(T t) { }
private static <T extends Function<Integer, Integer> & Serializable> void foo2(T t) { }
interface A<K> {}
}