}
else
{
-struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
+struct Symbol * symbol = (((void *)0));
+unsigned int findInGlobal = 0;
+if(!topContext->parent && exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && exp->destType->__anon1._class->__anon1.registered->type == 4)
+findInGlobal = 1;
+else
+symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
if(!symbol)
{
if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
}
}
+if(findInGlobal)
+symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
if(symbol)
{
struct Type * type = symbol->type;
}
else
{
- Symbol symbol = FindSymbol(id.string, curContext, topContext /*exp.destType ? topContext : globalContext*/, false, id._class && id._class.name == null);
+ Symbol symbol = null;
+ bool findInGlobal = false;
+ if(!topContext.parent && exp.destType && exp.destType.kind == classType && exp.destType._class && exp.destType._class.registered && exp.destType._class.registered.type == enumClass)
+ findInGlobal = true; // In global context, look at enum values first
+ else
+ symbol = FindSymbol(id.string, curContext, topContext /*exp.destType ? topContext : globalContext*/, false, id._class && id._class.name == null);
+
// Enums should be resolved here (Special pass in opExp to fix identifiers not seen as enum on the first pass)
if(!symbol/* && exp.destType*/)
{
symbol = FindSymbol(id.string, topContext.parent, globalContext, false, id._class && id._class.name == null);
}
}
+ if(findInGlobal)
+ symbol = FindSymbol(id.string, curContext, topContext, false, id._class && id._class.name == null);
// If we manage to resolve this symbol
if(symbol)