fix #2180
This commit is contained in:
parent
5dc6eda5a6
commit
32616a7269
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%COREVERSION%=3
|
||||
%REVISION%=2528
|
||||
%MINOR%=6
|
||||
%REVISION%=2529
|
||||
%COREVERSION%=3
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
3.6.3.2528
|
||||
3.6.3.2529
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.6.3.2528'
|
||||
!define VERSION '3.6.3.2529'
|
||||
|
|
|
|||
|
|
@ -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
21
TestSuite/extSelf.pas
Normal 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.
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue