Update of /cvsroot/nice/Nice/testsuite/compiler/overloading
In directory sc8-pr-cvs1:/tmp/cvs-serv27253/testsuite/compiler/overloading
Added Files:
compilation.testsuite
Log Message:
Make sure that when overloaded methods need to have different names in the
bytecode because they have the same bytecode types, the renaming is consistent
accross recompilations, so that existing code that is not recompiled does not
end up calling the wrong method.
--- NEW FILE: compilation.testsuite ---
/// PASS
/// package a
/// Toplevel
// Two methods that have the same bytecode type
int foo(int, int->int) = 1;
int foo(int, String->int) = 2;
// Calling from the same package
void test()
{
assert foo(0, int x => 0) == 1;
assert foo(0, String x => 0) == 2;
}
/// package b import a
test();
// Now calling from a different package
assert foo(0, int x => 0) == 1;
assert foo(0, String x => 0) == 2;
/// PASS
/// package a
/// Toplevel
// Two methods that have the same bytecode type
int foo(int, int->int) = 1;
int foo(int, String->int) = 2;
// Calling from the same package
void test()
{
assert foo(0, int x => 0) == 1;
assert foo(0, String x => 0) == 2;
}
/// package b import a
test();
// Now calling from a different package, in the opposite order
assert foo(0, String x => 0) == 2;
assert foo(0, int x => 0) == 1;
|