D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20125 - Different .stringof format for CT Sequences depending on content
Summary: Different .stringof format for CT Sequences depending on content
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 minor
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-12 12:29 UTC by Simen Kjaeraas
Modified: 2024-12-13 19:04 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Simen Kjaeraas 2019-08-12 12:29:27 UTC
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 dlangBugzillaToGithub 2024-12-13 19:04:54 UTC
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