On Monday, 15 April 2019 at 10:00:36 UTC, Alex wrote:
On Monday, 15 April 2019 at 08:39:24 UTC, Anton Fediushin wrote:
[snip]
Otherwise, you could alwas define fun as
´´´
void fun(Enum.internal e) {}
´´´
but I assume, you want to avoid especially this.
In favor of my first proposition, also speaks the fact, that
Enum.foo is somewhat awkward w.r.t. your question, as you treat
the internal enum as a static member. Was this intended?
Enum.internal is private to make it inaccessible from any other
place. All I want is a way to have an enum that I could extend
with my own methods.
Something to make the following code work:
```
Enum a = Enum.foo;
Enum b = Enum.bar;
assert(a == Enum.foo);
assert(a < b);
assert(a.toString == "FOO");
assert(b.toString == "BAR");
writeln(a); // FOO
writeln(b); // BAR
```