Bug 20125 – Different .stringof format for CT Sequences depending on content

Status
NEW
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-08-12T12:29:27Z
Last change time
2024-12-13T19:04:54Z
Assigned to
No Owner
Creator
Simen Kjaeraas
Moved to GitHub: dmd#19608 →

Comments

Comment #0 by simen.kjaras — 2019-08-12T12:29:27Z
import std.meta; static assert(AliasSeq!().stringof == "()"); static assert(AliasSeq!(1).stringof == "tuple(1)"); static assert(AliasSeq!(1,2).stringof == "tuple(1, 2)"); static assert(AliasSeq!(int).stringof == "(int)"); static assert(AliasSeq!(int, int).stringof == "(int, int)"); static assert(AliasSeq!(int, 2).stringof == "tuple((int), 2)"); static assert(AliasSeq!(int, 2, int, int).stringof == "tuple((int), 2, (int), (int))"); As we can see above, CT sequences containing at least one value has a "tuple" prefix, while others don't. Not only that, but mixed sequences wrap every type in (brackets).
Comment #1 by robert.schadek — 2024-12-13T19:04:54Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19608 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB