>________________________________ > From: Howard Page-Clark <h...@talktalk.net> >To: FPC users list <fpc-pascal@lists.freepascal.org> >Sent: Sunday, January 20, 2013 8:37 PM >Subject: [fpc-pascal] abstract classes > >FPC allows the Delphi-compatible "class abstract" syntax, but does not seem to >prevent instantiation of such a class. >The following code compiles and runs satisfactorily (FPC version 2.6.0) >Does trunk prevent this compiling? > >program Project1; > >{$mode objfpc}{$H+} > >type > TAbstractClass = class abstract > class function GetID: integer; static; > end; > >class function TAbstractClass.GetID: integer; >begin > Result:= 10; >end; > >var > ac: TAbstractClass; > >begin > ac:= TAbstractClass.Create; > WriteLn(ac.GetID); > ReadLn; > ac.Free; >end. >
As far as I remember Delphi has the same behavior. Leonardo M. Ramé http://leonardorame.blogspot.com _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal