开发者

Delphi 2010 compiler warning about instantiation of abstract class should be a compiler error

Is there any compiler options that开发者_StackOverflow中文版 let the compiler give me an error instead of a warning when i instantiate an abstract class?

Foo = class
    procedure Bar; virtual; abstract;
end;

var
    f : Foo;
begin
    f := Foo.Create;  // <-- should give me a compile time error
end;


In Delphi 2010 (at least, possibly earlier versions but cannot test/verify):

Project -> Options

  + Delphi Compiler

     > Hints and Warnings

         + Output Warnings:

              Constructing instance containing abstract method:  ___________

Change this setting from "True" to "Error"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜