This commit is contained in:
Ivan Bondarev 2024-03-26 21:49:51 +01:00
parent 02aae1768b
commit a969d6de9c
2 changed files with 26 additions and 0 deletions

21
TestSuite/lambdas23.pas Normal file
View file

@ -0,0 +1,21 @@
var j := 0;
type
t1 = class
static property prop1: integer read 1;
static constructor;
begin
var p := ()->
begin
j := prop1;
end;
p;
end;
end;
begin
var i := t1.prop1;
assert(j = 1);
end.

View file

@ -275,6 +275,11 @@ namespace TreeConverter.LambdaExpressions.Closure
dn = new dot_node(getClassIdent(classField.cont_type),
new ident(id.name, id.source_context), id.source_context);
}
else if (si.sym_info is common_property_node cpn && cpn.polymorphic_state == polymorphic_state.ps_static)
{
dn = new dot_node(getClassIdent(cpn.common_comprehensive_type),
new ident(id.name, id.source_context), id.source_context);
}
else if (si.sym_info is class_constant_definition ccd)
{
dn = new dot_node(getClassIdent(ccd.comperehensive_type),