[Issue 12499] New: tuple/TypeTuple 1-Arg initialization fails during CTFE.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Mar 31 07:24:39 PDT 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12499
Summary: tuple/TypeTuple 1-Arg initialization fails during
CTFE.
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: monarchdodra at gmail.com
--- Comment #0 from monarchdodra at gmail.com 2014-03-31 07:24:35 PDT ---
I'm not sure how "legal" this kind of initialization is to begin with (see:
https://d.puremagic.com/issues/show_bug.cgi?id=6367
).
In any case, it fails during CTFE.
//----
auto foo()
{
//Initialize 3 ints to 5.
TypeTuple!(int, int, int) a = 5;
return a[0]; //Error: variable _a_field_0 cannot be read at compile time
}
void main()
{
auto a = foo(); //OK
enum b = foo(); //FAILS
}
//----
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list