fixed build issue related to ?System

This commit is contained in:
Terky 2019-05-17 22:40:01 +03:00
parent e86dd93227
commit d9094a5c22
2 changed files with 14 additions and 9 deletions

View file

@ -1035,8 +1035,17 @@ namespace SymbolTable
// Нет. Как-то найти глобальное ПИ модуля
while (scope != null && !(scope is UnitInterfaceScope))
{
if (scope is ClassMethodScope)
scope = (scope as ClassMethodScope).DefScope;
if (scope is ClassMethodScope)
{
// aab 17.05.19 begin
// Поправил приоритет поиска для ?System
var classMethodScope = scope as ClassMethodScope;
if (classMethodScope.DefScope != null)
scope = classMethodScope.DefScope;
else
scope = classMethodScope.CurrentLambdaDefScope;
// aab 17.05.19 end
}
else scope = scope.TopScope;
}
if (scope != null)
@ -1155,12 +1164,8 @@ namespace SymbolTable
var defScope = (CurrentArea as ClassMethodScope).DefScope;
if (defScope != null)
{
var defScopeRes = FindAll(defScope, Name, OnlyInType, OnlyInThisClass, defScope);
if (defScopeRes != null && defScopeRes.Count > 0)
{
return defScopeRes;
}
CurrentArea = defScope;
continue;
}
}
}

View file

@ -1179,7 +1179,7 @@ namespace PascalABCCompiler.TreeConverter
// aab 26.04.19
// Здесь topScope записывается именно в CurrentLambdaDefScope, а не в DefScope
// Во всех остальных случаях записывается в DefScope
SymbolTable.Scope scope = convertion_data_and_alghoritms.symbol_table.CreateClassMethodScope(_ctn.Scope, topScope, null, "lambda " + name); // aab 09.05.19 Временно вернул обратно
SymbolTable.Scope scope = convertion_data_and_alghoritms.symbol_table.CreateClassMethodScope(_ctn.Scope, null, topScope, "lambda " + name);
//TODO:сделать static и virtual.
//TODO: interface and implementation scopes.