[Nice-commit] Nice/testsuite/compiler/methods syntax.testsuite,NONE,1.1
Brought to you by:
bonniot
From: <ar...@us...> - 2003-11-28 14:39:50
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv24232/F:/nice/testsuite/compiler/methods Added Files: syntax.testsuite Log Message: Added alternative syntax for patterns in method implementation 'Bar b' for 'b@Bar', '#Foo f' for 'f#Foo', 'Foo(Bar) f' for 'f@Foo(Bar)'. --- NEW FILE: syntax.testsuite --- /// PASS assert new A(x: 5).equals(new A(x: 5)); /// Toplevel class A { int x; equals(A other) = this.x == other.x; } /// PASS assert foo(new A()) == true; assert foo(new B()) == false; /// Toplevel class A {} class B extends A {} boolean foo(A x); foo(x) = false; foo(#A x) = true; /// PASS /// Toplevel interface X {} interface Y {} class A implements X, Y {} void foo(X x) {} void foo(Y y) {} foo(A(Y) y) {} |