[Nice-commit] Nice/testsuite/compiler/typing void.testsuite,NONE,1.1
Brought to you by:
bonniot
|
From: <bo...@us...> - 2003-03-13 23:19:43
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing
In directory sc8-pr-cvs1:/tmp/cvs-serv18669/testsuite/compiler/typing
Added Files:
void.testsuite
Log Message:
Allow functions returning a value to be used as arguments where
functions returning void are expected.
--- NEW FILE: void.testsuite ---
/// PASS
// A fonction A->B can be used where A->void is expected.
List<String> l = new LinkedList();
StringBuffer buffer = new StringBuffer( );
l.add( "foo" );
l.add( "bar" );
l.foreach( (String s) => buffer.append( s ) );
assert buffer.toString().equals("foobar");
/// FAIL
/// Toplevel
void goo() {
/* /// FAIL HERE */ return 1;
}
/// PASS
/// Toplevel
void foo(int i) {}
void goo() = foo(3);
/// FAIL
void x;
/// FAIL
/// Toplevel
var void x;
/// FAIL
/// Toplevel
void f(void x) {}
/// FAIL
/// Toplevel
void f(void) {}
|