Java: Don't cast the argument to generic type because we already know that the actual type is assignable to it (IDEA-171284)

This commit is contained in:
Pavel Dolgov
2018-06-29 13:27:21 +03:00
parent 8afdaeaca3
commit 9dce85a4fe
7 changed files with 82 additions and 15 deletions
@@ -0,0 +1,18 @@
class C {
<K> void method() {
class Local {
void foo(K k) {
newMethod(k);
}
private void newMethod(K k) {
System.out.println(k);
}
void bar() {
Object o = new Object();
newMethod(o);
}
}
}
}