mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 14:25:04 +07:00
apply capture conversion for captured wildcard bound according to the direct supertype of parameterized type specification (IDEA-157586)
This commit is contained in:
+1
@@ -4,5 +4,6 @@ interface B<T extends A<?>> { }
|
||||
class C {
|
||||
void foo(A<?> x){
|
||||
<error descr="Incompatible types. Found: 'A<capture<?>>', required: 'A<? extends B<? extends A<?>>>'">A<? extends B<? extends A<?>>> y = x;</error>
|
||||
Object y1 = (A<? extends B<? extends A<?>>>) x;
|
||||
}
|
||||
}
|
||||
+25
@@ -1,4 +1,6 @@
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
class Test {
|
||||
void f(List<? extends I<?>> list) {
|
||||
@@ -11,4 +13,27 @@ class Test {
|
||||
|
||||
interface I<Z> {
|
||||
}
|
||||
}
|
||||
|
||||
class Test1 {
|
||||
|
||||
private static void getMarketDataValues(ScenarioMarketData marketData,
|
||||
Set<? extends MarketDataId<?>> ids) {
|
||||
|
||||
ids.add(bar(marketData::getValue));
|
||||
}
|
||||
|
||||
interface ScenarioMarketData {
|
||||
<T> MarketDataBox<T> getValue(MarketDataId<T> id);
|
||||
}
|
||||
|
||||
interface MarketDataBox<J> {
|
||||
}
|
||||
|
||||
interface MarketDataId<M> {
|
||||
}
|
||||
|
||||
static <T, V> T bar(Function<T, V> valueExtractor) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user