mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
bad code green: reject return type constraint if unchecked conversion was applied during applicability check and return type is type parameter
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) {
|
||||
<error descr="Incompatible types. Found: 'java.lang.Enum', required: 'T'">return Enum.valueOf(type, str);</error>
|
||||
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</error>, str);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@ abstract class Group {
|
||||
}
|
||||
|
||||
public <T extends Category> T get(Key<T> key) {
|
||||
<error descr="Incompatible types. Found: 'Category', required: 'T'">return getCategory(key);</error>
|
||||
return getCategory<error descr="'getCategory(Key<R>)' in 'Group' cannot be applied to '(Key<T>)'">(key)</error>;
|
||||
}
|
||||
|
||||
public abstract <R extends Category<R>> R getCategory(Key<R> key);
|
||||
|
||||
Reference in New Issue
Block a user