summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbf/tw15303.pp
blob: 7c9276e71a1b6e5ec6177ad75096da7e903c9b1c (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
{ %fail }

program project1;
{$ifdef fpc}{$mode objfpc}{$H+}{$endif}

type
  IIntf1 = interface['{484A7AC5-114E-4D99-9E4F-7B4906413B2F}'] end;

  IIntf2 = interface['{3718A1FC-A6F6-4465-965D-14FF1CBA1902}']
    procedure Print2;
  end;

  TClass2 = class(TInterfacedObject, IIntf2)
    procedure Print2;
  end;

  TClass1 = class(TInterfacedObject, IIntf1, IIntf2)
    private
      FIntf2:IIntf2;
      function GetIntf2:IIntf2;cdecl; // <--- should be forbidden
    public
      constructor Create;
      property I:IIntf2 read GetIntf2 implements IIntf2;
  end;


procedure TClass2.Print2;
begin
  Writeln('doing something');
end;

function TClass1.GetIntf2: IIntf2;stdcall;
begin
  Result:=FIntf2;
end;

constructor TClass1.Create;
begin
  inherited Create;
  FIntf2:=TClass2.Create;
end;

begin
end.