mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 15:29:16 +02:00
* new tests
This commit is contained in:
parent
c6d03a29f0
commit
0aa1c49c9f
35
tests/tbs/tb0391.pp
Normal file
35
tests/tbs/tb0391.pp
Normal file
@ -0,0 +1,35 @@
|
||||
{$ifdef fpc}{$mode objfpc}{$endif}
|
||||
uses ub0391;
|
||||
|
||||
type
|
||||
tc1 = class
|
||||
procedure p1(l:longint);
|
||||
procedure p2;
|
||||
end;
|
||||
|
||||
procedure tc1.p1(l:longint);
|
||||
begin
|
||||
writeln('longint: ',l);
|
||||
end;
|
||||
|
||||
|
||||
procedure tc1.p2;
|
||||
var
|
||||
c2 : tc2;
|
||||
begin
|
||||
c2:=tc2.create;
|
||||
{ the next code should take tc1.p1(longint) as the tc2.p1 can not
|
||||
be seen from here! }
|
||||
with c2 do
|
||||
p1(100);
|
||||
c2.free;
|
||||
end;
|
||||
|
||||
|
||||
var
|
||||
c1 : tc1;
|
||||
begin
|
||||
c1:=tc1.create;
|
||||
c1.p2;
|
||||
c1.free;
|
||||
end.
|
19
tests/tbs/ub0391.pp
Normal file
19
tests/tbs/ub0391.pp
Normal file
@ -0,0 +1,19 @@
|
||||
{$ifdef fpc}{$mode objfpc}{$endif}
|
||||
unit ub0391;
|
||||
interface
|
||||
type
|
||||
tc2 = class
|
||||
protected
|
||||
procedure p1(s:string);
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
procedure tc2.p1(s:string);
|
||||
begin
|
||||
writeln('string: ',s);
|
||||
end;
|
||||
|
||||
|
||||
end.
|
Loading…
Reference in New Issue
Block a user