Enum literals, good? bad? what do you think?

Adam D Ruppe destructionator at gmail.com
Wed Jul 21 23:32:57 UTC 2021


On Wednesday, 21 July 2021 at 23:00:06 UTC, Walter Bright wrote:
> Just use it right after the declaration of the enum.

That limits the usefulness, but you still might as well do it 
right since then it works anywhere.

>> It doesn't get closer to the Swift examples.
>
> How so?

Consider:

import a;
import b;

foo(something);
bar(something);

foo and bar take different types that both have a member 
something. the swift examples resolve correctly. This does not 
and requires disambiguation on both uses.


More information about the Digitalmars-d mailing list