[Nice-commit] Nice/testsuite/compiler/typing instanceof.testsuite,1.13,1.14
Brought to you by:
bonniot
From: <bo...@us...> - 2003-11-24 19:22:05
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1:/tmp/cvs-serv27954/testsuite/compiler/typing Modified Files: instanceof.testsuite Log Message: Consider captured from all anonymous functions, even those that appear after the current point. Do not mark as captured local variables of an anonymous function when only accessed from that function. Index: instanceof.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/instanceof.testsuite,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** instanceof.testsuite 21 Nov 2003 13:03:38 -0000 1.13 --- instanceof.testsuite 24 Nov 2003 19:22:02 -0000 1.14 *************** *** 259,260 **** --- 259,288 ---- /// Toplevel class C extends B {} + + /// PASS + new LinkedList().foreach(A arg => { + arg = new B(); + if (arg instanceof B) { + assert arg.life == 42; + } + }); + + /// FAIL + ?int x = 1; + + let f = void->void g => { + if (x != null) { + g(); + int /*/// FAIL HERE*/ y = x; + } + }; + f(() => { x = null; }); + + /// PASS + Vector<A> ll = new Vector(); + ll.foreach(A arg => { + arg = new B(); + if (arg instanceof B) { + int x = arg.life; + } + }); |