[Nice-commit] Nice/testsuite/compiler/typing instanceof.testsuite,1.19,1.20
Brought to you by:
bonniot
From: Bryn K. <xo...@us...> - 2004-05-28 21:29:30
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18018/testsuite/compiler/typing Modified Files: instanceof.testsuite Log Message: Test for instanceof with type variables. Index: instanceof.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/instanceof.testsuite,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** instanceof.testsuite 30 Nov 2003 14:24:35 -0000 1.19 --- instanceof.testsuite 28 May 2004 21:29:20 -0000 1.20 *************** *** 320,321 **** --- 320,331 ---- assert x.life == 42; }); + + /// PASS bug + <T,U | U <: T> U narrow(T obj) + { + if (obj instanceof U) + return obj; + else + throw new ClassCastException(obj.getClass().getName()); + } + |