This commit is contained in:
Ivan Bondarev 2021-12-29 12:57:50 +01:00
parent 1ffec051f0
commit db48b41fd0
2 changed files with 23 additions and 0 deletions

View file

@ -8300,7 +8300,9 @@ namespace PascalABCCompiler.NETGenerator
FieldInfo fi = fi_info.fi; FieldInfo fi = fi_info.fi;
is_dot_expr = true; is_dot_expr = true;
has_dereferences = false; has_dereferences = false;
is_field_reference = true;
value.obj.visit(this); value.obj.visit(this);
is_field_reference = false;
bool has_dereferences_tmp = has_dereferences; bool has_dereferences_tmp = has_dereferences;
has_dereferences = false; has_dereferences = false;
is_dot_expr = false; is_dot_expr = false;

21
TestSuite/where19.pas Normal file
View file

@ -0,0 +1,21 @@
type
t1 = class
f := true;
end;
procedure p<T>(o: T); where T: t1;
begin
var oo := o;
assert(oo.f);
oo.f := false; // Записывает неправильно
assert(not oo.f);
o.f := true;
assert(oo.f);
o.f := false;
assert(not oo.f);
end;
begin
var a := new t1;
p(a);
end.