[Nice-commit] Nice/regtest/basic methods.nice,1.2,1.3
Brought to you by:
bonniot
|
From: <bo...@us...> - 2003-04-02 15:56:24
|
Update of /cvsroot/nice/Nice/regtest/basic
In directory sc8-pr-cvs1:/tmp/cvs-serv21094/regtest/basic
Modified Files:
methods.nice
Log Message:
Test dispatch on null values, rather than relying on notNull, which is a
feature unrelated to methods.
Index: methods.nice
===================================================================
RCS file: /cvsroot/nice/Nice/regtest/basic/methods.nice,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** methods.nice 18 Sep 2001 12:39:55 -0000 1.2
--- methods.nice 2 Apr 2003 15:56:18 -0000 1.3
***************
*** 4,10 ****
class C2 extends C1 {}
! String name(C1);
name(c@C1) = "C1";
name(c@C2) = "C2";
void test_methods();
--- 4,11 ----
class C2 extends C1 {}
! String name(?C1);
name(c@C1) = "C1";
name(c@C2) = "C2";
+ name(@null) = "NULL class";
void test_methods();
***************
*** 15,23 ****
println(name(new C2()));
?C1 c = null;
! try{
! println(name(notNull(c)));
! }
! catch(NullPointerException ex){
! println("NULL class");
! }
}
--- 16,19 ----
println(name(new C2()));
?C1 c = null;
! println(name(c));
}
|