[fpc-devel] [Patch/RFC] Warnings for (in/over)complete case statements

Martok listbox at martoks-place.de
Wed Jan 2 18:21:29 CET 2019


Am 02.01.2019 um 17:56 schrieb Michael Van Canneyt:
> The compiler can prove that since the methods are private.
> It can see no explicit calls are generated for it.

I thought so too, but even with added explicit calls, there is no warning.
Plus, it could only reason for this class if it was strict private, otherwise,
anyone in this module could access it.

Doesn't seem to be class related, even this very obvioulsy wrong segment
generates no warning:
    function GetString(AIndex: Integer): string;
    begin
       case AIndex of
        1 : Result:= 'abc';
       end;
    end;

    begin
      writeln(GetString(42));
    end.

-- 
Regards,
Martok





More information about the fpc-devel mailing list