Update of /cvsroot/nice/Nice/testsuite/compiler/typing
In directory sc8-pr-cvs1:/tmp/cvs-serv11194/testsuite/compiler/typing
Modified Files:
null.testsuite
Log Message:
The non-null marker '!' is smaller than any nullness marker.
Index: null.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/null.testsuite,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** null.testsuite 27 Apr 2003 19:32:26 -0000 1.7
--- null.testsuite 31 Aug 2003 00:32:56 -0000 1.8
***************
*** 38,39 ****
--- 38,62 ----
void f(?String) {}
void f(?java.io.File) {}
+
+ /// PASS
+ // Checks that ! is the minimum amond nullness markers.
+ /// Toplevel
+ interface Method <R,A> {
+ R call(A a);
+ }
+
+ abstract class OOMemoize<R,A> implements Method<R,A> {
+ HashMap<A,R> table = new HashMap();
+
+ R protomethod(A a);
+ }
+
+ <R,A> call(this@OOMemoize, a){
+ if (this.table.containsKey(a))
+ return notNull(this.table.get(a));
+ else {
+ let R m = this.protomethod(a);
+ this.table.put(a,m);
+ return m;
+ }
+ }
|