Global types accessible when asking for type in namespace

Started by
1 comment, last by WitchLord 2 years, 6 months ago

In scripts, and when using GetTypeInfoByDecl, it is possible to get a global type when asking for a namespaced type (which might not even exist). For example, registering an enum Foo in the global namespace and then calling GetTypeInfoByDecl("Bar::Foo") results in it returning the type of the global Foo.

The following script should throw (several) compiler errors, but it doesn't:

enum SomeEnum {
  X
}

class SomeClass {
}

void Main() {
  Bar::SomeEnum e;
  Bar::SomeClass c;
}
Advertisement

Thanks for letting me know about this.

I'll investigate and fix this.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement