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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 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: -------