Nice/testsuite/compiler/typing void.testsuite,1.4,1.5
Daniel Bonniot <[email protected]>
| Newsgroups | gmane.comp.lang.nice.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/nice/Nice/testsuite/compiler/typing
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18310/testsuite/compiler/typing
Modified Files:
void.testsuite
Log Message:
Allow value returns in void methods. We don't need to distinguish between
real and "fake" (sugared) returns.
Index: void.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/void.testsuite,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** void.testsuite 8 Nov 2003 14:59:48 -0000 1.4
--- void.testsuite 7 Mar 2005 17:10:49 -0000 1.5
***************
*** 10,17 ****
assert buffer.toString().equals("foobar");
! /// FAIL
/// Toplevel
! void goo() {
! /* /// FAIL HERE */ return 1;
}
--- 10,43 ----
assert buffer.toString().equals("foobar");
! /// PASS
! foo(0);
! foo(1);
/// Toplevel
! void fooZero() {}
!
! void foo(int x)
! {
! if (x == 0)
! return fooZero();
!
! // do something else
! }
!
! /// PASS
! let a = new A();
! a.add(1);
! a.add(0);
! /// Toplevel
! class A
! {
! StringBuffer s = new StringBuffer();
!
! void add(int x)
! {
! if (x == 0)
! return s.append("ZERO\n");
!
! // do something complex
! }
}
***************
*** 59,62 ****
--- 85,93 ----
?String bar() = "abc";
+ /// PASS
+ /// Toplevel
+ void foo() { if (1 == 2) return bar(); }
+ ?String bar() = "abc";
+
/// FAIL
let x = foo();
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click