A strange bug Bale stumbled upon in his Adventure Advisor relay script. I could reduce the issue to the following code:
results in
test( 2, any_map ) calls test(int, string) instead of test(int, int[int]).
I haven't had time to look at the source yet, but it sounds like fun one to track down.
Switching the order in which the test() functions are defined by adding
at the beginning of the code above fixes the issue.
PHP:
# must be test(<something>, string)
void test( int something, string toprint )
{
print( "test( string, string ) called" );
print( "toprint = " + toprint );
}
# must have the same name as the function above
# (it must be an override)
void test( int whatever, int [int] m )
{
print( "test( int, int [int] ) called" );
test( whatever, "a string" );
}
int [int] any_map;
test( 2, any_map );
Code:
> call test.ash
test( string, string ) called
toprint = aggregate int [int]
I haven't had time to look at the source yet, but it sounds like fun one to track down.
Switching the order in which the test() functions are defined by adding
PHP:
void test( int whatever, int [int] m );
void test( int something, string toprint );
Last edited: