[Nice-commit] Nice/testsuite/compiler/methods globalconstant.testsuite,NONE,1.1
Brought to you by:
bonniot
From: <ar...@us...> - 2003-06-12 16:46:55
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv21551/F:/nice/testsuite/compiler/methods Added Files: globalconstant.testsuite Log Message: Implemented dispatch on global constants with a literal value. --- NEW FILE: globalconstant.testsuite --- /// PASS /// Toplevel let int ONE = 1; let int TWO = 2; int fib(int n); fib(n@int) = fib(n-2) + fib(n-1); fib(ONE) = 1; fib(TWO) = 1; /// PASS assert(foo("abc")); /// Toplevel let String abc = "abc"; let String xyz = "xyz"; boolean foo(String); foo(s) = false; foo(abc) = true; foo(xyz) = false; /// FAIL /// Toplevel let int xxx = 10; void foo(int); foo(n) {} foo(xxx) {} foo(10) {} /// FAIL /// Toplevel var int xxx = 10; void foo(int); foo(n) {} foo(xxx) {} /// PASS assert(foo("abc")); /// Toplevel let String abc = "abc"; class A { String abc = ""; } boolean foo(String); foo(s) = false; foo(abc) = true; |