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

Dukc ajieskola at gmail.com
Sat Nov 19 08:55:52 UTC 2022


On Saturday, 19 November 2022 at 08:44:34 UTC, Andrey Zherikov 
wrote:
>
> Will this be better if it's supported?
> ```d
> auto flag = with(MySuperLongType)
>             ValueA | ValueB | ValueC | ValueD | ValueE | ValueF 
> | ValueG;
> ```

I'd like that sure! In this case yes IMO.

The proposed syntax is still better though when you reassign to 
an already declared value.

```D
flag &= $.ValueA | $.ValueC;
```

Whether that's a strong enough case to implement the proposal 
alongside expression `with`s, is another question. I haven't 
decided my opinion yet.


More information about the Digitalmars-d mailing list