mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 14:29:34 +02:00

interface: the compiler does not/cannot check whether the class implements all required methods in that case, and it moreover leads to crashes (mantis #24184). Older versions of Delphi did allow this (and don't check whether the interface methods are implemented either), but that's simply a (similar) bug in Delphi that has been fixed in XE at least * fixed compilation of webtbs/tw2727 after this fix git-svn-id: trunk@24177 -
38 lines
731 B
ObjectPascal
38 lines
731 B
ObjectPascal
{ Source provided for Free Pascal Bug Report 2727 }
|
|
{ Submitted by "marco (the gory bugs department)" on 2003-10-08 }
|
|
{ e-mail: }
|
|
|
|
{$mode delphi}
|
|
|
|
|
|
type
|
|
IPersistenceCapable = interface
|
|
['{A7F3DA50-93BF-4EAF-B40C-8F5020E5D890}']
|
|
function GetSelf: TObject;
|
|
property Self: TObject read GetSelf;
|
|
end;
|
|
|
|
TPersistenceCapable = class(TInterfacedObject, IPersistenceCapable)
|
|
function GetSelf: TObject;
|
|
function nonsense:boolean;
|
|
end;
|
|
|
|
function TPersistenceCapable.GetSelf: TObject;
|
|
begin
|
|
result:=nil;
|
|
end;
|
|
|
|
function TPersistenceCapable.nonsense:boolean;
|
|
{this works fine if it isn't a method....}
|
|
|
|
var
|
|
lSource: IPersistenceCapable;
|
|
|
|
begin
|
|
result:=(lSource.Self is TPersistenceCapable)
|
|
end;
|
|
|
|
|
|
begin
|
|
end.
|