Вдогонку к свойствам с полем в надклассе

This commit is contained in:
Mikhalkovich Stanislav 2020-05-23 23:34:02 +03:00
parent f0db733c96
commit 51f3d79066
8 changed files with 47 additions and 7 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3"; public const string Major = "3";
public const string Minor = "6"; public const string Minor = "6";
public const string Build = "3"; public const string Build = "3";
public const string Revision = "2484"; public const string Revision = "2485";
public const string MainVersion = Major + "." + Minor; public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%COREVERSION%=3
%REVISION%=2484
%MINOR%=6 %MINOR%=6
%REVISION%=2485
%COREVERSION%=3
%MAJOR%=3 %MAJOR%=3

View file

@ -1 +1 @@
3.6.3.2484 3.6.3.2485

View file

@ -1 +1 @@
!define VERSION '3.6.3.2484' !define VERSION '3.6.3.2485'

View file

@ -0,0 +1,13 @@
type
A<T> = class
fielda: T;
end;
B<T> = class(A<T>)
property PropA: T read fielda;
end;
begin
var b1 := new B<integer>;
Assert(b1.PropA = 0);
end.

View file

@ -0,0 +1,13 @@
type
A<T> = class
fielda: integer := 1;
end;
B<T> = class(A<T>)
property PropA: integer read fielda;
end;
begin
var b1 := B&<integer>.Create;
Assert(b1.Propa = 1);
end.

View file

@ -0,0 +1,14 @@
type
A<T> = class
fielda: integer := 1;
end;
B<T> = class(A<T>)
property PropA: integer write fielda read fielda;
end;
begin
var b1 := B&<integer>.Create;
b1.Propa := 2;
Assert(b1.Propa = 2);
end.

View file

@ -4652,7 +4652,7 @@ namespace PascalABCCompiler.TreeConverter
} }
} }
common_method_node cmn = new common_method_node( common_method_node cmn = new common_method_node(
AcessorName, loc, cf.cont_type, AcessorName, loc, /*cf.cont_type,*/ cpn.comprehensive_type as common_type_node,
cf.polymorphic_state, context.get_field_access_level(), null); cf.polymorphic_state, context.get_field_access_level(), null);
cpn.common_comprehensive_type.methods.AddElement(cmn); cpn.common_comprehensive_type.methods.AddElement(cmn);
common_parameter cp = new common_parameter( common_parameter cp = new common_parameter(
@ -4671,7 +4671,7 @@ namespace PascalABCCompiler.TreeConverter
var_ref = new static_class_field_reference(cf, loc); var_ref = new static_class_field_reference(cf, loc);
} }
cmn.function_code = find_operator(compiler_string_consts.assign_name, var_ref, cpr, loc); cmn.function_code = find_operator(compiler_string_consts.assign_name, var_ref, cpr, loc);
cf.cont_type.scope.AddSymbol(AcessorName, new SymbolInfo(cmn)); cf.cont_type.Scope.AddSymbol(AcessorName, new SymbolInfo(cmn));
return cmn; return cmn;
} }