mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 21:44:49 +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:
+12
@@ -0,0 +1,12 @@
|
||||
import java.util.List;
|
||||
|
||||
class Test {
|
||||
<T> T foo(List<T> l) {
|
||||
return l.get(0);
|
||||
}
|
||||
|
||||
void m(List l){
|
||||
<error descr="Incompatible types. Found: 'java.lang.Object', required: 'boolean'">boolean foo = foo(l);</error>
|
||||
<error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.lang.String'">String s = foo(l);</error>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user