Default argument ignored(?) when imported function is using it. In case of int, no matter what value was given in function declaration, it's always 0.
// module 1
import void test2( bool dummy, int x = -1 ) from "test2";
void test( bool dummy, int x = -1 )
{
Log( "x = "+x );
}
void check()
{
Log( "TEST" );
test( true );
test( true, -2 );
test( true, 2 );
Log( "TEST2" );
test2( false );
test2( false, -2 );
test2( false, 2 );
}
// module 2
void test2( bool dummy, int x = -1 )
{
Log( "x = "+x );
}
Output is:
TEST
x = -1
x = -2
x = 2
TEST2
x = 0
x = 0
x = 0
Code above may refuse to compile for some reason. I got or crashes, or infinite loop (or maybe it just looks like this for me) on scripts loading (with both loading from source or bytecode), or no problems at all. Tested with r1558 and r1563.