[Issue 22644] Using @disable on enum members produces unrelated errors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 3 05:11:44 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=22644

Tejas_Garhewal <scienticman at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |scienticman at gmail.com

--- Comment #2 from Tejas_Garhewal <scienticman at gmail.com> ---
I understand that this issue has been declared resolved, but a workaround until
the underlying issue is solved(via enhancing phobos or something else) is to
use stringof property

```d
enum Foo {
    x = 7,
    @disable y = 8,
}

void main() {
    writefln("Hello %s", Foo.x.stringof);
}

```
It also correctly fails to compile if you write Foo.y.stringof

--


More information about the Digitalmars-d-bugs mailing list