소스 검색

no message

florian 22 년 전
부모
커밋
15eef9c65a
1개의 변경된 파일34개의 추가작업 그리고 0개의 파일을 삭제
  1. 34 0
      tests/tbs/tb0459.pp

+ 34 - 0
tests/tbs/tb0459.pp

@@ -0,0 +1,34 @@
+{ %version=1.1 }
+{$mode objfpc}
+Type
+  IMyInterface = Interface
+    Function MyFunc : Integer;
+  end;
+
+  TMyClass = Class(TInterfacedObject,IMyInterface)
+    Function MyOtherFunction : Integer;
+    // The following fails in FPC.
+    Function IMyInterface.MyFunc = MyOtherFunction;
+  end;
+
+Function TMyClass.MyOtherFunction : Integer;
+
+begin
+  Result:=23;
+end;
+
+Var
+  A : TMyClass;
+  M : IMyInterface;
+  I : Integer;
+
+begin
+  A:=TMyClass.Create;
+  M:=A;
+  I:=M.MyFunc;
+  If (I<>23) then
+    begin
+    Writeln('Error calling interface');
+    Halt(1);
+    end;
+end.