mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 18:59:40 +02:00
* small extension of the test
git-svn-id: trunk@26066 -
This commit is contained in:
parent
897c8b8f7b
commit
3e393b867b
@ -20,6 +20,11 @@ type
|
||||
procedure extraproc(a: longint); override;
|
||||
end;
|
||||
|
||||
MyObject2 = objcclass(NSObject)
|
||||
// overrides extraproc added to NSObject
|
||||
procedure extraproc(a: longint); override;
|
||||
end;
|
||||
|
||||
procedure MyCategory.extraproc(a: longint);
|
||||
begin
|
||||
if a<>1 then
|
||||
@ -33,10 +38,18 @@ procedure MyObject.extraproc(a: longint);
|
||||
inherited extraproc(1);
|
||||
end;
|
||||
|
||||
procedure MyObject2.extraproc(a: longint);
|
||||
begin
|
||||
if a<>3 then
|
||||
halt(3);
|
||||
inherited extraproc(1);
|
||||
end;
|
||||
|
||||
|
||||
var
|
||||
a: NSObject;
|
||||
b: MyObject;
|
||||
c: MyObject2;
|
||||
begin
|
||||
a:=NSObject.alloc.init;
|
||||
a.extraproc(1);
|
||||
@ -44,4 +57,7 @@ begin
|
||||
b:=MyObject.alloc.init;
|
||||
b.extraproc(2);
|
||||
b.release;
|
||||
c:=MyObject.alloc.init;
|
||||
c.extraproc(2);
|
||||
c.release;
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user