mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
unchecked warning: mark as unchecked if passed to strict subtyping (IDEA-151302)
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
class Foo<T extends Enum> {
|
||||
public T bar(Class<? extends T> type, String str) {
|
||||
return Enum.valueOf<error descr="'valueOf(java.lang.Class<T>, java.lang.String)' in 'java.lang.Enum' cannot be applied to '(java.lang.Class<capture<? extends T>>, java.lang.String)'">(type, str)</error>;
|
||||
<error descr="Incompatible types. Found: 'java.lang.Enum', required: 'T'">return Enum.valueOf(type, str);</error>
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import java.util.List;
|
||||
|
||||
interface FacetId<T extends List> {}
|
||||
|
||||
abstract class One {
|
||||
public abstract <F extends List<C>, C extends One> void findFacetType(FacetId<F> typeId);
|
||||
private void addSubFacet(FacetId<?> underlyingType) {
|
||||
findFacetType(underlyingType);
|
||||
}
|
||||
}
|
||||
|
||||
class Bar<X extends Foo> {}
|
||||
class Foo<C> {}
|
||||
class Main {
|
||||
void foo(Bar<?> a) {
|
||||
m(a);
|
||||
}
|
||||
|
||||
<X extends Foo<C>, C> void m(Bar<X> a) {
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -12,7 +12,10 @@ class Test {
|
||||
SuperFoo<String> ls = foo(<error descr="no instance(s) of type variable(s) exist so that String conforms to Number
|
||||
inference variable R has incompatible bounds:
|
||||
equality constraints: String
|
||||
upper bounds: Object, Number">() -> new Foo<>()</error>);
|
||||
upper bounds: Object, Number
|
||||
inference variable X has incompatible bounds:
|
||||
equality constraints: R
|
||||
upper bounds: Number">() -> new Foo<>()</error>);
|
||||
SuperFoo<Integer> li = foo(() -> new Foo<>());
|
||||
SuperFoo<?> lw = foo(() -> new Foo<>());
|
||||
}
|
||||
Reference in New Issue
Block a user