[Issue 20762] __traits(isSame) is underspecified for enums and literals

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 24 17:12:47 UTC 2020


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

Adam D. Ruppe <destructionator at gmail.com> changed:

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

--- Comment #1 from Adam D. Ruppe <destructionator at gmail.com> ---
I'm of the opinion that the current behavior of `static assert(__traits(isSame,
x, 1));` is buggy because of that line in the spec. It also affects eponymous
templates which are otherwise indistinguishable from the literal (which is a
good thing - major optimization opportunity in the compiler by taking advantage
of this).

But either way, it needs to be very clearly defined.

--


More information about the Digitalmars-d-bugs mailing list