mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 00:49:31 +02:00

- postpone insertion of hidden params into record methods after the full record parse to prevent interface and implementation difference because of the possible record size change after the method parse (issue #0021044) - skip hidden arguments during methods search for a property setter because of the above change and also for consistency with getter method search - test git-svn-id: trunk@20161 -
38 lines
765 B
ObjectPascal
38 lines
765 B
ObjectPascal
{ %norun}
|
|
program tw21044;
|
|
|
|
{$mode Delphi}
|
|
|
|
uses
|
|
SysUtils, Classes;
|
|
|
|
type
|
|
{ TTestRecord }
|
|
|
|
TTestRecord = record
|
|
public
|
|
function Test(const Lhs, Rhs: TTestRecord): TTestRecord;
|
|
// operator overloads
|
|
class operator Add(const Lhs, Rhs: TTestRecord): TTestRecord;
|
|
// this part changes the size of record and so the way of parameter handling
|
|
// on some 64bit systems
|
|
case Boolean of
|
|
False: (Value: Single);
|
|
True: (AsInteger: Integer);
|
|
end;
|
|
|
|
{ TTestRecord }
|
|
|
|
function TTestRecord.Test(const Lhs, Rhs: TTestRecord): TTestRecord;
|
|
begin
|
|
Result.AsInteger := Lhs.AsInteger + Rhs.AsInteger;
|
|
end;
|
|
|
|
class operator TTestRecord.Add(const Lhs, Rhs: TTestRecord): TTestRecord;
|
|
begin
|
|
Result.Value := Lhs.Value + Rhs.Value;
|
|
end;
|
|
|
|
begin
|
|
end.
|