conditional expression: ensure return type is primitive short in case of short/byte branches (IDEA-126697)

This commit is contained in:
Anna Kozlova
2014-06-30 14:03:38 +02:00
parent 3732aaf36c
commit fca471c397
3 changed files with 15 additions and 2 deletions
@@ -0,0 +1,8 @@
class Test {
private static void <warning descr="Private method 'test(java.lang.Short)' is never used">test</warning>(Short s) { System.out.println("Short:" + s); }
private static void test(short s) { System.out.println("short:" + s); }
public static void main(String ... args) {
test(true ? new Short((short) 1) : new Byte((byte) 1));
}
}