Hi, we have been using the 2011-12-28 version of the sdk until lately. We have been encountering some issues with namespacing from within the UnigineScripts with the newer version (2012-04-11, which we are aware is not the latest).
1. using keyword can only be used if the code is encapsulated within a namespace also.
with error (Interpreter::parse_prototype():can't find "myNamespace::subNamespace" namespace):
using myNamespace::subNamespace;
MyObject object;
int init() {
object = new MyObject();
return 1;
}
without error:
namespace World {
using myNamespace::subNamespace;
MyObject object;
int init() {
object = new MyObject();
return 1;
}
}
2. the second code snippet would work but the interpreter cannot properly parse the world init because it is now contained within a namespace, instead we have to do this:
int init() {
return World::init();
}
namespace World {
using myNamespace::subNamespace;
MyObject object;
int init() {
object = new MyObject();
return 1;
}
}
Is this intended behavior?