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

IchorDev zxinsworld at gmail.com
Sun Nov 20 16:25:06 UTC 2022


On Saturday, 19 November 2022 at 04:22:39 UTC, Walter Bright 
wrote:
> Consider this:
>
>     enum A { a; }
>     enum B { a; }
>
>     void f(A);
>     void f(B);
>
>     ...
>     f($a + $a); // mentioned in the DIP as allowed
>     ...
>
> Since the DIP allows expressions containing such enum 
> inferences, it looks like we are faced with the possibility of 
> having to re-run the semantic pass for enum arguments for every 
> enum overload.

If you're sure that arithmetic and ETI won't mix for 
implementation reasons then I could explicitly prohibit it. My 
only apprehension is that `OR`ing enum flags with ETI is very 
handy.


More information about the Digitalmars-d mailing list