This commit is contained in:
Бондарев Иван 2018-05-21 14:41:43 +02:00
parent 51d81ad056
commit 9477f6982b
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,17 @@
type
t1 = class//не работает только в классе
const c1 = 5;
procedure p1;
begin
var arr1 := ArrGen(1, i -> c1);//В данной версии компилятора не поддерживается замыкание данного типа символов
assert(arr1[0] = 5);
end;
end;
begin
var t := new t1;
t.p1;
end.

View file

@ -158,6 +158,7 @@ namespace TreeConverter.LambdaExpressions.Closure
si.sym_info.semantic_node_type == semantic_node_type.common_unit_node ||
si.sym_info.semantic_node_type == semantic_node_type.compiled_unit_node ||
si.sym_info.semantic_node_type == semantic_node_type.template_type ||
si.sym_info.semantic_node_type == semantic_node_type.class_constant_definition ||
si.sym_info.semantic_node_type == semantic_node_type.basic_function_node && idName == "exit")
{
return;
@ -167,6 +168,7 @@ namespace TreeConverter.LambdaExpressions.Closure
si.sym_info.semantic_node_type == semantic_node_type.local_block_variable ||
si.sym_info.semantic_node_type == semantic_node_type.common_parameter ||
si.sym_info.semantic_node_type == semantic_node_type.class_field
;
if (!(acceptableVarType) && InLambdaContext)