Bug 12499 – tuple/TypeTuple 1-Arg initialization fails during CTFE.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-31T07:24:00Z
Last change time
2014-04-07T15:42:27Z
Keywords
CTFE, pull, rejects-valid
Assigned to
nobody
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2014-03-31T07:24:35Z
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 } //----
Comment #1 by k.hara.pg — 2014-04-03T02:28:40Z
Comment #2 by github-bugzilla — 2014-04-07T13:39:25Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c53eb66756f2911f50e103068d4b8575bfbc5542 fix Issue 12499 - tuple/TypeTuple 1-Arg initialization fails during CTFE https://github.com/D-Programming-Language/dmd/commit/d9864ef218a423e3c6946e5b6d745fb9e6729ef6 Merge pull request #3420 from 9rnsr/fix12499 Issue 12499 - tuple/TypeTuple 1-Arg initialization fails during CTFE