mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
inference: check glb with captured wildcard: if not assignable check if it is an interface
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
|
||||
interface Condition<T> {
|
||||
boolean value(T t);
|
||||
}
|
||||
abstract class Test {
|
||||
|
||||
protected static <Impl extends AbstractCache, T extends OCSymbol> T findNearestTopLevelSymbol(Class<Impl> clazz,
|
||||
Condition<? super T> condition) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
interface OCSymbol {}
|
||||
interface SwiftSymbol extends OCSymbol {}
|
||||
|
||||
|
||||
class AbstractCache<T extends OCSymbol> {}
|
||||
class SwiftCache extends AbstractCache<SwiftSymbol> {}
|
||||
|
||||
private static void foo(final Condition<? super SwiftSymbol> condition) {
|
||||
SwiftSymbol s = findNearestTopLevelSymbol(SwiftCache.class, condition);
|
||||
}
|
||||
private static void foo1(final Condition<? extends SwiftSymbol> condition) {
|
||||
SwiftSymbol s = findNearestTopLevelSymbol(SwiftCache.class, condition);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user