I have some binding code along these lines:
engine->SetDefaultNamespace("MyNamespace");
engine->RegisterObjectType("MyType", sizeof(MyType), asOBJ_VALUE | as OBJ_POD | ...);
engine->RegisterObjectMethod("SomeObject", "MyType AFunction(MyType param = MyType()) const", ...);
If in script you call AFunction() and don't provide the default parameter, that script will fail to compile with:
Identifier 'MyType' is not a data type
A cast operator has one argument
Identifier 'MyType' is not a data type
The type of the default argument expression doesn't match the function parameter type
Is it possible to make the compiler look at the current 'default namespace' when resolving this default parameter?
Thank you!