mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 10:00:32 +02:00
parent
174015662d
commit
4245b8129c
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1013,6 +1013,8 @@ components/codetools/tests/fpctests/tchlp7.pp svneol=native#text/plain
|
||||
components/codetools/tests/laztests/README.txt svneol=native#text/plain
|
||||
components/codetools/tests/laztests/bug28861_unit1.pas svneol=native#text/plain
|
||||
components/codetools/tests/laztests/bug28861_unit2.pas svneol=native#text/plain
|
||||
components/codetools/tests/laztests/bug28866_prg.pas svneol=native#text/plain
|
||||
components/codetools/tests/laztests/bug28866_unit1.pas svneol=native#text/plain
|
||||
components/codetools/tests/laztests/tdefaultproperty1.pas svneol=native#text/plain
|
||||
components/codetools/tests/parsertbase.pas svneol=native#text/plain
|
||||
components/codetools/tests/parsertest.lpi svneol=native#text/plain
|
||||
|
@ -40,7 +40,7 @@
|
||||
<PackageName Value="fpcunitconsolerunner"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="11">
|
||||
<Units Count="13">
|
||||
<Unit0>
|
||||
<Filename Value="finddeclarationtest.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -85,6 +85,14 @@
|
||||
<Filename Value="fpctests/README.txt"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit10>
|
||||
<Unit11>
|
||||
<Filename Value="laztests/bug28866_prg.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit11>
|
||||
<Unit12>
|
||||
<Filename Value="laztests/bug28866_unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit12>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
15
components/codetools/tests/laztests/bug28866_prg.pas
Normal file
15
components/codetools/tests/laztests/bug28866_prg.pas
Normal file
@ -0,0 +1,15 @@
|
||||
program bug28866_prg;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
bug28866_unit1;
|
||||
|
||||
var
|
||||
S: String;
|
||||
O: TObject;
|
||||
begin
|
||||
S.Twice{declaration:bug28866_unit1.TStringHelper.Twice};
|
||||
O.Test{declaration:bug28866_unit1.TObjectHelper.Test};
|
||||
end.
|
||||
|
49
components/codetools/tests/laztests/bug28866_unit1.pas
Normal file
49
components/codetools/tests/laztests/bug28866_unit1.pas
Normal file
@ -0,0 +1,49 @@
|
||||
unit bug28866_unit1;
|
||||
|
||||
{$mode delphi}
|
||||
|
||||
interface
|
||||
|
||||
{ TStringHelper }
|
||||
|
||||
type
|
||||
TStringHelper = record helper for string
|
||||
private
|
||||
function GetTheLength: Integer;
|
||||
public
|
||||
function Twice: string;
|
||||
function Thrice: string;
|
||||
property TheLength: Integer read GetTheLength;
|
||||
end;
|
||||
|
||||
TObjectHelper = class helper for TObject
|
||||
public
|
||||
function Test: Integer;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TObjectHelper }
|
||||
|
||||
function TObjectHelper.Test: Integer;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
function TStringHelper.GetTheLength: Integer;
|
||||
begin
|
||||
Result := Length(Self)
|
||||
end;
|
||||
|
||||
function TStringHelper.Twice: string;
|
||||
begin
|
||||
Result := Self + Self;
|
||||
end;
|
||||
|
||||
function TStringHelper.Thrice: string;
|
||||
begin
|
||||
Result := Self + Self + Self;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user