The feature I'd most like to see in Delphi is....

Type inference for scoped enumerations

If I assign a value to a variable of most simple data types I just assign a value, e.g.

AInteger := 1;
ADouble := 1;
AString := 'Hello';

etc. There's no need to specify a type:

AInteger := Integer.1;

However, with scoped enumerations commonly used especially in FireMonkey I do need to specify the type:

Layout1.Align := TAlignLayout.Client;

This is very wordy, frequently catches out newbies and means I often have to look up type names.

Instead the compiler should know what type I am assigning to (or passing a parameter to) and /infer/ the type of the enumeration from that:

Layout1.Align := Client;

1 vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Mike Sutton shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base