mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 14:09:20 +02:00
* new bugs
This commit is contained in:
parent
7b52f09302
commit
c334674c1a
13
tests/webtbf/tw2357.pp
Normal file
13
tests/webtbf/tw2357.pp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{ %fail }
|
||||||
|
|
||||||
|
unit tw2357;
|
||||||
|
interface
|
||||||
|
type
|
||||||
|
TQ = class(TObject)
|
||||||
|
public
|
||||||
|
procedure DoSome(const X); virtual; abstract;
|
||||||
|
function GetSome : integer; virtual; overload;
|
||||||
|
function GetSome : string; virtual; overload; abstract;
|
||||||
|
end;
|
||||||
|
implementation
|
||||||
|
end.
|
27
tests/webtbf/tw2383.pp
Normal file
27
tests/webtbf/tw2383.pp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{ %fail }
|
||||||
|
|
||||||
|
{ Source provided for Free Pascal Bug Report 2383 }
|
||||||
|
{ Submitted by "Anton Roolaid" on 2003-02-18 }
|
||||||
|
{ e-mail: Anton.Roolaid@mail.ee }
|
||||||
|
program VarParameterLoop;
|
||||||
|
|
||||||
|
const
|
||||||
|
Elements = 3; { Array size }
|
||||||
|
Arr: array [0 .. Elements - 1] of char = ('B', 'U', 'G');
|
||||||
|
|
||||||
|
function FindIndex(chElement: char; var iIndex: integer): boolean;
|
||||||
|
begin
|
||||||
|
FindIndex := false; { Not found }
|
||||||
|
{ Using a variable parameter should not be allowed }
|
||||||
|
for iIndex := 0 to Elements - 1 do
|
||||||
|
if Arr[iIndex] = chElement then exit(true) { Found }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
i: integer;
|
||||||
|
begin
|
||||||
|
if FindIndex('U', i) then
|
||||||
|
writeln('The index is ', i)
|
||||||
|
else
|
||||||
|
writeln('Not found')
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user