[Nice-commit] Nice/testsuite/compiler/typing instanceof.testsuite,1.1,1.2
Brought to you by:
bonniot
From: <bo...@us...> - 2003-08-28 08:46:35
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1:/tmp/cvs-serv20751/testsuite/compiler/typing Modified Files: instanceof.testsuite Log Message: Allow assignments to local variables whose type was dynamically inferred after an instanceof. We now use the same scheme as for null tests, since that is more powerful in handling branches. Index: instanceof.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/instanceof.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** instanceof.testsuite 27 Aug 2003 09:33:45 -0000 1.1 --- instanceof.testsuite 28 Aug 2003 08:46:32 -0000 1.2 *************** *** 25,26 **** --- 25,57 ---- ; assert a.life == 42; + + /// PASS + A a; + a = new B(); + if (a instanceof B) + ; + else + throw new Error(); + assert a.life == 42; + + /// COMMENT Assignments. + /// PASS + A a = new B(); + if (a instanceof B) + { + int i = a.life; + if (i == 42) + a = new A(); + else + i = a.life + 1; + } + + /// FAIL + A a = new B(); + if (a instanceof B) + { + int i = a.life; + if (i == 42) + a = new A(); + i = a.life; + } |