forbid cast primitive to type parameter (IDEA-52484; IDEA-23260)

This commit is contained in:
anna
2011-08-25 12:34:35 +02:00
parent 77188dec6b
commit 008326cc84
3 changed files with 13 additions and 1 deletions

View File

@@ -81,4 +81,10 @@ class Casting {
private static String[] parseArray(Object obj) {
return obj.toString().split(",");
}
}
class CastPrimitiveToTypeParam<T> {
T foo() {
return <error descr="Inconvertible types; cannot cast 'int' to 'T'">(T)1</error>;
}
}