Files
Tagir Valeevandintellij-monorepo-bot 47b811fe9f [java-dfa] Properly implement increment/decrement for array operand
Fixes IDEA-296799 'Constant conditions & exceptions' false positive when incrementing an array value

GitOrigin-RevId: f018dc670016473a6cf80c06a91b80cb48afb4e0
2022-06-30 08:49:29 +00:00

17 lines
413 B
Java

public class ArrayWriteFlush {
public static void main(String[] args) {
int[] a = {0, 0};
int d = nextInt();
int x = a[d]++;
System.out.println(a[0] + a[1]);
System.out.println(x);
}
private static native int nextInt();
void invalidType() {
Object obj = 0;
<error descr="Operator '++' cannot be applied to 'java.lang.Object'">obj++</error>;
System.out.println(obj);
}
}