I want to disable a specific warning (W1035) in my code, since I think that the compiler is wrong about this warning:
function TfrmNagScreen.Run: TOption;
begin
if ShowModal = mrOk then
Result := TOption(rdgAction.EditValue)
else
Abort
end;
There is no way the result could be undefined, since Abort
throws EAbort
.
I tried:
{$WARN 1035 Off}
: Apparently this only works for some specific errors (see Documentation){$W-1035}
: Does nothing at all
I know I can switch off the warning globally in the project options, or using {$WARNINGS OFF}
, but that is not what is intended here.
Edit: I have QC'ed this now as #89744.