This commit is contained in:
Бондарев Иван 2017-10-15 19:29:50 +02:00
parent 59973c9535
commit b2ac415b2c
2 changed files with 34 additions and 1 deletions

View file

@ -0,0 +1,24 @@
var i: integer;
type
t2 = class
procedure Redraw;
begin
i := 1;
end;
constructor(Redraw: boolean);
begin
var p:procedure := ()->
begin
if Redraw then
self.Redraw;
end;
p;
end;
end;
begin
new t2(true);
assert(i = 1);
end.

View file

@ -2130,6 +2130,15 @@ namespace PascalABCCompiler.TreeConverter
SymbolInfoList si = curscope.Find(name, curscope);
SymbolInfoList si2 = null;
if (si != null && si.First().scope is SymbolTable.ClassScope && curscope.TopScope is SymbolTable.BlockScope && curscope.TopScope.TopScope is SymbolTable.ClassMethodScope && curscope.TopScope.TopScope.TopScope is SymbolTable.BlockScope)
{
si2 = curscope.TopScope.TopScope.TopScope.Find(name, curscope.TopScope.TopScope.TopScope);
if (si2 != null && si2.First().scope is SymbolTable.ClassMethodScope)
{
si = si2;
}
}
if (si == null && _compiled_tn != null && curscope.TopScope != null)
{