// fails static assert(__traits(isSame, AliasSeq!(1, 2), AliasSeq!(1, 2))); // passes static assert(__traits(isSame, AliasSeq!(1, 1), AliasSeq!(1, 1))); If the tuples are meant to expand, then both assertions should fail with a "wrong number of arguments" error. Otherwise, both assertion should pass. To me, the most consistent semantics would be for __traits(isSame) to behave as a template with two alias parameters (it would be necessary to nest tuples in another template before passing them to __traits(isSame)).
this is a cool bug. The fact that this 3rd case passes explains it all: static assert(__traits(isSame, AliasSeq!(1, 1), AliasSeq!(2, 2))); in traits semantic, the two args are actually a list that expands in place to (1,1,2,2) and finally what get compared is the two elements of what was the first trait argument ! awesome bug isn't it !!
@NilsLankila created dlang/dmd pull request #11373 "fix issue 20761 - __traits(isSame) for alias tuples is broken and und…" fixing this issue: - fix issue 20761 - __traits(isSame) for alias tuples is broken and underspecified https://github.com/dlang/dmd/pull/11373
dlang/dmd pull request #11373 "fix issue 20761 - __traits(isSame) for alias tuples is broken and und…" was merged into master: - c8b470c05b001853f83cbf1b5d9e0e66ef1b2ca4 by Nils Lankila: fix issue 20761 - __traits(isSame) for alias tuples is broken and underspecified https://github.com/dlang/dmd/pull/11373
dlang/dmd pull request #11392 "Add tests for issue 20761 - __traits(isSame) for alias tuples..." was merged into master: - 5f68732fe07f981f0359f665930dfb852367ac29 by MoonlightSentinel: Add tests for issue 20761 - __traits(isSame) for alias tuples... ... is brokenand underspecified https://github.com/dlang/dmd/pull/11392