bug fix #474
This commit is contained in:
parent
aaebcf48c9
commit
5f28848d1f
|
|
@ -2351,7 +2351,7 @@ namespace PascalABCCompiler.NETGenerator
|
||||||
funcs.Add(func); //здесь наверное дублирование
|
funcs.Add(func); //здесь наверное дублирование
|
||||||
MethodBuilder tmp = cur_meth;
|
MethodBuilder tmp = cur_meth;
|
||||||
cur_meth = methb;
|
cur_meth = methb;
|
||||||
ConvertCommonFunctionConstantDefinitions(func.constants);
|
|
||||||
//если функция не содержит вложенных процедур, то
|
//если функция не содержит вложенных процедур, то
|
||||||
//переводим переменные как локальные
|
//переводим переменные как локальные
|
||||||
if (func.functions_nodes.Length > 0)
|
if (func.functions_nodes.Length > 0)
|
||||||
|
|
@ -2413,6 +2413,7 @@ namespace PascalABCCompiler.NETGenerator
|
||||||
il = cur_meth.GetILGenerator();
|
il = cur_meth.GetILGenerator();
|
||||||
smi.Push(mi);
|
smi.Push(mi);
|
||||||
funcs.Add(func);
|
funcs.Add(func);
|
||||||
|
ConvertCommonFunctionConstantDefinitions(func.constants);
|
||||||
if (func.functions_nodes.Length == 0)
|
if (func.functions_nodes.Length == 0)
|
||||||
ConvertLocalVariables(func.var_definition_nodes);
|
ConvertLocalVariables(func.var_definition_nodes);
|
||||||
|
|
||||||
|
|
|
||||||
14
TestSuite/const3.pas
Normal file
14
TestSuite/const3.pas
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
const
|
||||||
|
h = Round(1.3);
|
||||||
|
h2 = h;
|
||||||
|
|
||||||
|
procedure Test;
|
||||||
|
const dh = h;
|
||||||
|
begin
|
||||||
|
assert(dh = 1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Test;
|
||||||
|
assert(h2 = h);
|
||||||
|
end.
|
||||||
Loading…
Reference in a new issue