Bug 21510 – __traits(isSame, a, AliasSeq!a) returns true if "a" is a scalar

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-12-28T10:03:11Z
Last change time
2024-12-13T19:13:42Z
Keywords
spec
Assigned to
No Owner
Creator
Max Samukha
Moved to GitHub: dmd#19846 →

Comments

Comment #0 by maxsamukha — 2020-12-28T10:03:11Z
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
Comment #1 by robert.schadek — 2024-12-13T19:13:42Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19846 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB