Type Inference for Struct/Enum Literals

ryuukk_ ryuukk.dev at gmail.com
Mon Jul 8 07:02:34 UTC 2024


On Sunday, 7 July 2024 at 19:07:10 UTC, Nick Treleaven wrote:
> On Saturday, 6 July 2024 at 08:04:36 UTC, ryuukk_ wrote:
>> The pushback is from people who never got to learn new 
>> languages, they believe this is what everyone wants to write
>
> They do not believe that.
>
> The proposal is fine except where it breaks existing code. I 
> don't think editions should redefine syntax without a very good 
> reason. There is a limited budget for breakage per edition. (An 
> example of such a reason is breaking bug-prone code).
>
>> `MySelfExplanatoryType flag = MySelfExplanatoryType.A | 
>> MySelfExplanatoryType.B MySelfExplanatoryType.C;`
>
> You could write:
> ```d
> auto flag = { with (MySelfExplanatoryType) return A | B | C; 
> }();
> ```


No, this syntax is just bad, it's unreadable and over engineered


More information about the dip.ideas mailing list