fix #1323
This commit is contained in:
parent
1ac993bc58
commit
226ab08fbd
19
TestSuite/lambdas_generics7.pas
Normal file
19
TestSuite/lambdas_generics7.pas
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
type
|
||||||
|
t1<T>=class
|
||||||
|
static p: Action<T>;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure p0<T>;
|
||||||
|
begin
|
||||||
|
var p1: Action<T>;
|
||||||
|
p1 := o1->t1&<T>.p(o1);//Ошибка: В данной версии компилятора не поддерживается замыкание данного типа символов
|
||||||
|
p1(default(T));
|
||||||
|
end;
|
||||||
|
|
||||||
|
var i: integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
t1&<integer>.p := x -> begin i := 1; end;
|
||||||
|
p0&<integer>;
|
||||||
|
assert(i = 1);
|
||||||
|
end.
|
||||||
|
|
@ -164,6 +164,7 @@ namespace TreeConverter.LambdaExpressions.Closure
|
||||||
si.sym_info.semantic_node_type == semantic_node_type.common_namespace_node ||
|
si.sym_info.semantic_node_type == semantic_node_type.common_namespace_node ||
|
||||||
si.sym_info.semantic_node_type == semantic_node_type.compiled_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.template_type ||
|
||||||
|
si.sym_info.semantic_node_type == semantic_node_type.generic_indicator ||
|
||||||
si.sym_info.semantic_node_type == semantic_node_type.class_constant_definition ||
|
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")
|
si.sym_info.semantic_node_type == semantic_node_type.basic_function_node && idName == "exit")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3055,6 +3055,7 @@ namespace PascalABCCompiler.TreeRealization
|
||||||
private void add_delegate_operator(string name, compile_time_executor executor)
|
private void add_delegate_operator(string name, compile_time_executor executor)
|
||||||
{
|
{
|
||||||
common_namespace_function_node cnfn = new common_namespace_function_node(name, this, null, null, null);
|
common_namespace_function_node cnfn = new common_namespace_function_node(name, this, null, null, null);
|
||||||
|
|
||||||
cnfn.ConnectedToType = this;
|
cnfn.ConnectedToType = this;
|
||||||
cnfn.compile_time_executor = executor;
|
cnfn.compile_time_executor = executor;
|
||||||
add_name(name, new SymbolInfo(cnfn));
|
add_name(name, new SymbolInfo(cnfn));
|
||||||
|
|
@ -3064,6 +3065,7 @@ namespace PascalABCCompiler.TreeRealization
|
||||||
cnfn, concrete_parameter_type.cpt_none, null, null);
|
cnfn, concrete_parameter_type.cpt_none, null, null);
|
||||||
cnfn.parameters.AddElement(cp1);
|
cnfn.parameters.AddElement(cp1);
|
||||||
cnfn.parameters.AddElement(cp2);
|
cnfn.parameters.AddElement(cp2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//private bool ctors_inited = false;
|
//private bool ctors_inited = false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue