namespace test
{
enum ETest { A, B }
class CTest {
CTest(const ETest v = ETest::A) {}
}
}
void main()
{
test::CTest a;
}
Prepare the above code and execute it.
> asrun.exe script2.as
script2.as (15, 1) : INFO : Compiling void main()
default arg (1, 1) : ERR : Unknown scope 'ETest'
script2.as (17, 15) : ERR : Failed while compiling default arg for parameter 0 in function 'test::CTest@ CTest(const test::ETest = ETest :: A)'
Abnormally ends after outputting the above.
Describing the namespace as below will compile successfully.
CTest(const ETest v = test::ETest::A) {}