han*_*aad 9 delphi compiler-errors compiler-warnings delphi-2010
当我实例化抽象类时,是否有任何编译器选项让编译器给我一个错误而不是一个警告?
Foo = class
procedure Bar; virtual; abstract;
end;
var
f : Foo;
begin
f := Foo.Create; // <-- should give me a compile time error
end;
Run Code Online (Sandbox Code Playgroud)
Del*_*ics 18
在Delphi 2010中(至少可能是早期版本但无法测试/验证):
Project -> Options
+ Delphi Compiler
> Hints and Warnings
+ Output Warnings:
Constructing instance containing abstract method: ___________
Run Code Online (Sandbox Code Playgroud)
将此设置从" True " 更改为" Error "
| 归档时间: |
|
| 查看次数: |
1632 次 |
| 最近记录: |