warn about compilable code which would lead to runtime ClassCastException in addition to unchecked warning which nobody understands (IDEA-154345)

This commit is contained in:
Anna.Kozlova
2016-04-15 18:43:24 +02:00
parent 24fbcb7563
commit bb6394162a
3 changed files with 46 additions and 2 deletions
@@ -0,0 +1,10 @@
class Test {
<S extends Runnable> S f() {
return null;
}
{
String m <warning descr="Though assignment is formal correct, it could lead to ClassCastException at runtime. Expected: 'String', actual: 'Runnable & String'">=</warning> f();
System.out.println(m);
}
}