blob: 245291706b9e60b2d0332b738f2ec53d3385f325 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
{ %fail }
program intfbug2;
{$ifdef fpc}
{$mode objfpc} {$H+}
{$endif fpc}
uses
Classes, SysUtils;
type
IMyCom1 = interface
procedure A1;
end;
IMyCom2 = interface
procedure A2;
end;
TMyComCorba = class(TInterfacedObject, IMyCom1, IMyCom2)
procedure A1;
procedure A2;
procedure B;
end;
procedure TMyComCorba.A1;
begin
WriteLN('Com1');
end;
procedure TMyComCorba.A2;
begin
WriteLN('Com2');
end;
procedure TMyComCorba.B;
begin
WriteLN('Corba');
end;
var
I: IUnknown;
A1: IMyCom1;
A2: IMyCom2;
begin
I := TMyComCorba.Create;
A1 := I as IMyCom1;
A1.A1;
A2 := I as IMyCom2;
A2.A2;
end.
|