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

zjh fqbqrr at 163.com
Tue Nov 22 10:06:24 UTC 2022


On Tuesday, 22 November 2022 at 09:37:43 UTC, bauss wrote:

> Example:
>
> ```d
> class A { static int a = 1; static int b = 2; }
> enum B { b = 3, c = 4 }
> int c = 5;
>
> void main() {
>   writeln(.a);
>   writeln(.b);
>   writeln(.c);
> }
> ```
>
> Prints:
>
> 1
> 3
> 5


```d
class A { static int a = 1; static int b = 2; }
enum B { b = 3, c = 4 }
int c = 5;

void main() {
   with A,B;
   writeln(a);
   writeln(b);
   writeln(c);
}
```



More information about the Digitalmars-d mailing list