[Issue 21510] New: __traits(isSame, a, AliasSeq!a) returns true if "a" is a scalar
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Dec 28 10:03:11 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21510
Issue ID: 21510
Summary: __traits(isSame, a, AliasSeq!a) returns true if "a" is
a scalar
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Keywords: spec
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: maxsamukha at gmail.com
https://github.com/dlang/dmd/pull/11392 implies that the language designers
decided not to flatten template argument tuples (or whatever is he right name)
passed to __traits(isSame). The PR partially implements the decision but makes
no distinction between a singleton tuple and a scalar, which introduces an
undesirable inconsistency:
static assert(is(int == AliasSeq!int)); // false as expected
static assert(__traits(isSame, int, AliasSeq!int); // true, but false is
expected
--
More information about the Digitalmars-d-bugs
mailing list