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

Basile.B b2.temp at gmx.com
Mon Nov 21 14:49:05 UTC 2022


On Friday, 18 November 2022 at 15:37:31 UTC, Mike Parker wrote:
> ## Discussion Thread
>
> This is the discussion thread for the first round of Community 
> Review of DIP 1044, "Enum Type Inference":
>
> https://github.com/dlang/DIPs/blob/e2ca557ab9d3e60305a37da0d5b58299e0a9de0e/DIPs/DIP1044.md
>
> The review period will **end at 11:59 PM ET on December 3**, or 
> when I make a post declaring it complete. Discussion in this 
> thread may continue beyond that point.
>
> Here in the discussion thread, you are free to discuss anything 
> and everything related to the DIP. Express your support or 
> opposition, debate alternatives, argue the merits, etc.
>
> However, if you have any specific feedback on how to improve 
> the proposal itself, then please post it in the Feedback 
> Thread. The Feedback Thread will be the source for the review 
> summary that I will write at the end of this review round. I 
> will post a link to that thread immediately following this 
> post. Just be sure to read and understand the Reviewer 
> Guidelines before posting there:
>
> https://github.com/dlang/DIPs/blob/master/docs/guidelines-reviewers.md
>
> And my blog post on the difference between the Discussion and 
> Feedback threads:
>
> https://dlang.org/blog/2020/01/26/dip-reviews-discussion-vs-feedback/
>
> Please stay on topic here. I will delete posts that are 
> completely off-topic.

The EnumExpression shortucts the whole shadowing problem

     EnumExpression ::= "enum" "." Identifier

So when that kind of expression is resolved, you just have to 
look at if there's an enum put in the current scope for that 
special inference case and if it contains the right member.

That would look like this

     EnumType myBitset = enum.flag1 | enum.flag3

So you push `EnumType` in the scope used to solve the assign 
expression.
you see ?




More information about the Digitalmars-d mailing list