Reported By: Ralf Mimoun Reported On: 8/14/2022 For: Version 3.02 Build 7
# 4898Mismatched Method Declarations with Default Parameters Not Caught by the Compiler In Delphi , if you define default parameter values for methods or functions in the interface part of a unit, you don't have to repeat that in the implementation part. Example below.
"s" is "Undefined". Same with integers, they are NaN.
Imho, this is a very serious problem because the code does not behave as expected, and you have to change all your code, hoping that you find all places. Or you don't use default values at all.
Even a compiler error like "Default values in interface, but not in implementation" would help.
unit Unit1;
interface
procedure x(s: string = '');
implementation
procedure x(s: string);
begin
ShowMessage(s);
end;
ResolutionFixed Problem on 8/20/2022 in version 3.02 build 8
Products AffectedElevate Web Builder Elevate Web Builder Trial