fix #850
This commit is contained in:
parent
51d81ad056
commit
9477f6982b
17
TestSuite/lambdas_closures_14.pas
Normal file
17
TestSuite/lambdas_closures_14.pas
Normal 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.
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue