This commit is contained in:
Ivan Bondarev 2022-04-18 11:37:39 +02:00
parent 674ca7d5cf
commit 3f63253daf
2 changed files with 21 additions and 1 deletions

View file

@ -5643,8 +5643,10 @@ namespace PascalABCCompiler.NETGenerator
is_addr = false;
//is_dot_expr = false;
is_field_reference = true;
bool tmp_virtual_method_call = virtual_method_call;
virtual_method_call = false;
value.obj.visit(this);
virtual_method_call = tmp_virtual_method_call;
is_addr = temp_is_addr;
FldInfo fi_info = helper.GetField(value.field);
#if DEBUG

18
TestSuite/generics64.pas Normal file
View file

@ -0,0 +1,18 @@
type
// не обязательно auto класс, я добавил только ради конструктора
t0 = auto class
f: byte;
end;
procedure p1<T>(o: T); where T: t0;
begin
assert(o.f.ToString.Println = '123');
assert(o.f.ToString = '123');
assert(o.f = 123);
// Обязательно захватить o
var p := procedure->(o := o);
end;
begin
p1(new t0(123));
end.