Feedback Thread: DIP 1044--Enum Type Inference--Community Review Round 1

IchorDev zxinsworld at gmail.com
Mon Nov 21 16:29:23 UTC 2022


On Friday, 18 November 2022 at 21:29:15 UTC, Walter Bright wrote:
> The following is not addressed:
>
>     enum E { e };
>     int e;
>     auto x = e;  // which e?
>
>     void bahb(int);
>     void bahb(E);
>     bahb(e);  // which bahb?

Your example is written without using ETI.
It should look like this if you want to use the enum member with 
ETI:
```d
enum E { e }
int e;
auto x = $e; //E.e

void bahb(int);
void bahb(E x);
bahb($e); //E.e
```
Otherwise the local variable will be used, because that's how D 
works.


More information about the Digitalmars-d mailing list