This commit is contained in:
parent
9020b84b98
commit
1f58cbe273
17
TestSuite/property7.pas
Normal file
17
TestSuite/property7.pas
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
type
|
||||
t1 = abstract class
|
||||
|
||||
private p1_val: boolean := false;
|
||||
property p1: boolean read p1_val; virtual;
|
||||
end;
|
||||
|
||||
t2 = class(t1)
|
||||
x: boolean := true;
|
||||
property p1: boolean read x; override;
|
||||
end;
|
||||
|
||||
begin
|
||||
var a := new t2;
|
||||
assert(a.p1);
|
||||
assert((a as t1).p1);
|
||||
end.
|
||||
19
TestSuite/property8.pas
Normal file
19
TestSuite/property8.pas
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
type
|
||||
t1 = abstract class
|
||||
|
||||
private p1_val: boolean := false;
|
||||
property p1: boolean read p1_val; virtual;
|
||||
|
||||
end;
|
||||
|
||||
t2 = class(t1)
|
||||
|
||||
property p1: boolean read boolean(true); override;
|
||||
|
||||
end;
|
||||
|
||||
begin
|
||||
var a := new t2;
|
||||
assert(a.p1);
|
||||
assert((a as t1).p1);
|
||||
end.
|
||||
19
TestSuite/property9.pas
Normal file
19
TestSuite/property9.pas
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
type
|
||||
t1 = abstract class
|
||||
|
||||
private p1_val: boolean := false;
|
||||
property p1: boolean read p1_val; virtual;
|
||||
|
||||
end;
|
||||
|
||||
t2 = class(t1)
|
||||
|
||||
property p1: boolean read boolean(true); reintroduce;
|
||||
|
||||
end;
|
||||
|
||||
begin
|
||||
var a := new t2;
|
||||
assert(a.p1);
|
||||
assert(not (a as t1).p1);
|
||||
end.
|
||||
|
|
@ -4780,7 +4780,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
}
|
||||
common_method_node cmn = new common_method_node(
|
||||
AcessorName, loc, /*cf.cont_type,*/ cpn.comprehensive_type as common_type_node,
|
||||
cf.polymorphic_state, context.get_field_access_level(), null);
|
||||
cpn.polymorphic_state, context.get_field_access_level(), null);
|
||||
cpn.common_comprehensive_type.methods.AddElement(cmn);
|
||||
common_parameter cp = new common_parameter(
|
||||
compiler_string_consts.value, cf.type, SemanticTree.parameter_type.value,
|
||||
|
|
@ -4826,7 +4826,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
}
|
||||
common_method_node cmn = new common_method_node(
|
||||
AcessorName, loc, /*cf.cont_type,*/ cpn.comprehensive_type as common_type_node,
|
||||
cf.polymorphic_state, context.get_field_access_level(), null);
|
||||
cpn.polymorphic_state, context.get_field_access_level(), null);
|
||||
cpn.common_comprehensive_type.methods.AddElement(cmn);
|
||||
cmn.return_value_type = cf.type;
|
||||
cmn.is_overload = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue