This commit is contained in:
Mikhalkovich Stanislav 2020-06-26 14:07:44 +03:00
parent 5dc6eda5a6
commit 32616a7269
8 changed files with 56 additions and 5 deletions

View file

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

View file

@ -1,4 +1,4 @@
%COREVERSION%=3
%REVISION%=2528
%MINOR%=6
%REVISION%=2529
%COREVERSION%=3
%MAJOR%=3

View file

@ -1 +1 @@
3.6.3.2528
3.6.3.2529

View file

@ -1 +1 @@
!define VERSION '3.6.3.2528'
!define VERSION '3.6.3.2529'

View file

@ -39,6 +39,16 @@ function RlnR3 := ReadlnReal3;
function RlnC3 := ReadlnChar3;
function RlnS3 := ReadlnString3;
function RI4 := ReadInteger4;
function RR4 := ReadReal4;
function RC4 := ReadChar4;
function RS4 := ReadString4;
function RlnI4 := ReadInteger4;
function RlnR4 := ReadlnReal4;
function RlnC4 := ReadlnChar4;
function RlnS4 := ReadlnString4;
function RAI(n: integer) := ReadArrInteger(n);
function RAR(n: integer) := ReadArrReal(n);

21
TestSuite/extSelf.pas Normal file
View file

@ -0,0 +1,21 @@
// #2180
type
t1 = class end;
function f1(self: t1; x: integer): integer; extensionmethod;
begin
Result := x * x;
end;
type
t2 = class(t1)
procedure test;
begin
Assert(f1(4)=16);
Assert(Self.f1(4)=16);
end;
end;
begin
t2.Create.test;
end.

View file

@ -7303,6 +7303,16 @@ namespace PascalABCCompiler.TreeConverter
//lroman//
#endregion
// #2180 - в уникальной ситуации, когда из метода потомка вызывается метод расширения класса-предка добавлять Self (!)
// Это значит, что dereferencing_value - это идентификатор и sil состоит только (?) из методов расширения
if (_method_call.dereferencing_value is ident)
{
if (sil.Select(s=>s.sym_info).Where(s=>s is function_node).All(s => (s as function_node).is_extension_method))
{
var en0 = convert_strong(new ident("Self"));
exprs.AddElementFirst(en0);
}
}
expr_node = convertion_data_and_alghoritms.create_full_function_call(exprs, sil, mcloc,
context.converted_type, context.top_function, proc_wait, _method_call.parameters?.expressions);
}

View file

@ -39,6 +39,16 @@ function RlnR3 := ReadlnReal3;
function RlnC3 := ReadlnChar3;
function RlnS3 := ReadlnString3;
function RI4 := ReadInteger4;
function RR4 := ReadReal4;
function RC4 := ReadChar4;
function RS4 := ReadString4;
function RlnI4 := ReadInteger4;
function RlnR4 := ReadlnReal4;
function RlnC4 := ReadlnChar4;
function RlnS4 := ReadlnString4;
function RAI(n: integer) := ReadArrInteger(n);
function RAR(n: integer) := ReadArrReal(n);