2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / libjava / testsuite / libjava.lang / N19990310_4.java
blobad89a505bc76f7d2c88d2cc68dccbe7d72fa8cd2
1 /*--------------------------------------------------------------------------*/
2 /* Name : N19990310_4.java */
3 /* : */
4 /* Cause : assignment operator makes error in char,byte,short variable */
5 /* : */
6 /* Message : In class `N19990310_4': */
7 /* : In method `main(java.lang.String[])': */
8 /* : Incompatible type for `='. Explicit cast needed to convert `*/
9 /* : `int' to `char'. */
10 /* : x += (x = 3); */
11 /* : ^ */
12 /* : 1 error */
13 /*--------------------------------------------------------------------------*/
15 public class N19990310_4 {
16 public static void main(String[] args) {
17 char x = 9;
19 x += (x = 3);
20 if ( x == 12 ) {
21 System.out.println("OK");
22 } else {
23 System.out.println("NG");