bug fix #837
This commit is contained in:
parent
7e9e302f12
commit
0d592e78e0
21
TestSuite/records7.pas
Normal file
21
TestSuite/records7.pas
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
type
|
||||||
|
r1=record
|
||||||
|
|
||||||
|
class Empty := default(r1);
|
||||||
|
|
||||||
|
end;
|
||||||
|
r2=record
|
||||||
|
|
||||||
|
a,b:byte;
|
||||||
|
class Empty := default(r2);
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
var a := new r2;
|
||||||
|
var b := new r2;
|
||||||
|
assert(a = b);
|
||||||
|
assert(not (a <> b));
|
||||||
|
b.a := 2;
|
||||||
|
assert(a <> b);
|
||||||
|
end.
|
||||||
|
|
@ -1033,7 +1033,9 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
statements_list body = new statements_list(null);
|
statements_list body = new statements_list(null);
|
||||||
foreach (class_field cf in _ctn.fields)
|
foreach (class_field cf in _ctn.fields)
|
||||||
{
|
{
|
||||||
expression_node left = new class_field_reference(cf,new common_parameter_reference(prm1,0,null),null);
|
if (cf.polymorphic_state == SemanticTree.polymorphic_state.ps_static)
|
||||||
|
continue;
|
||||||
|
expression_node left = new class_field_reference(cf,new common_parameter_reference(prm1,0,null),null);
|
||||||
expression_node right = new class_field_reference(cf,new common_parameter_reference(prm2,0,null),null);
|
expression_node right = new class_field_reference(cf,new common_parameter_reference(prm2,0,null),null);
|
||||||
expression_node cond = SystemLibrary.SystemLibrary.syn_visitor.find_operator(compiler_string_consts.noteq_name,
|
expression_node cond = SystemLibrary.SystemLibrary.syn_visitor.find_operator(compiler_string_consts.noteq_name,
|
||||||
left,right,null);
|
left,right,null);
|
||||||
|
|
@ -1065,6 +1067,8 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
statements_list body = new statements_list(null);
|
statements_list body = new statements_list(null);
|
||||||
foreach (class_field cf in _ctn.fields)
|
foreach (class_field cf in _ctn.fields)
|
||||||
{
|
{
|
||||||
|
if (cf.polymorphic_state == SemanticTree.polymorphic_state.ps_static)
|
||||||
|
continue;
|
||||||
expression_node left = new class_field_reference(cf,new common_parameter_reference(prm1,0,null),null);
|
expression_node left = new class_field_reference(cf,new common_parameter_reference(prm1,0,null),null);
|
||||||
expression_node right = new class_field_reference(cf,new common_parameter_reference(prm2,0,null),null);
|
expression_node right = new class_field_reference(cf,new common_parameter_reference(prm2,0,null),null);
|
||||||
expression_node cond = SystemLibrary.SystemLibrary.syn_visitor.find_operator(compiler_string_consts.eq_name,
|
expression_node cond = SystemLibrary.SystemLibrary.syn_visitor.find_operator(compiler_string_consts.eq_name,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue