www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12499] New: tuple/TypeTuple 1-Arg initialization fails during CTFE.

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: monarchdodra gmail.com


--- Comment #0 from monarchdodra 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: -------
Mar 31 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12499


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid
            Version|unspecified                 |D2


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2014-04-03 02:28:40 PDT ---
https://github.com/D-Programming-Language/dmd/pull/3420

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 03 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12499



--- Comment #2 from github-bugzilla puremagic.com 2014-04-07 13:39:25 PDT ---
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

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 07 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12499


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 07 2014