The following code does not generate a compiler warning in D6. Can I make it warn me about pointing ps at an integer when I have told it that ps points to a string?
procedure Test;
var
i: integer;
s, m: string;
ps: ^string;
begin
s := 'Test message';
ps := @s;
m := ps^;
MessageDlg(m, mtInformation, [mbOK], 0); // This displays 'Test message'.
ps := @i; // I would like a warning here.
m := ps^;
MessageDlg(m, mtInformation, [mbOK], 0); // This might display garbage.
end;