accept narrowing conversion from byte[] to T< extends Serializable> (IDEA-113225)

This commit is contained in:
Anna Kozlova
2013-09-05 19:56:35 +04:00
parent 002eadb1ea
commit 5ac8d00c35
3 changed files with 13 additions and 1 deletions
@@ -0,0 +1,11 @@
import java.io.Serializable;
public class Test {
public <T extends Serializable> void foo(byte[] data) {
T foo = (T) data;
}
public <T extends Serializable & Runnable> void bar(byte[] data) {
T bar = <error descr="Inconvertible types; cannot cast 'byte[]' to 'T'">(T) data</error>;
}
}