www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3263] New: Cannot use tuple foreach arguments in an array literal

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3263

           Summary: Cannot use tuple foreach arguments in an array literal
           Product: D
           Version: 1.017
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: clugdbug yahoo.com.au


This is the second bug report in bug #1298, which is completely unrelated to
the first one.
----
template Foo(Strings...)
{
    const a2 = [Strings]; 
}

alias Foo!("one", "two") foo;

// Error: cannot implicitly convert expression (tuple("one","two")) of type
(char[3], char[3]) to char

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 25 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3263


Shin Fujishiro <rsinfu gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |rsinfu gmail.com
         Resolution|                            |DUPLICATE


--- Comment #1 from Shin Fujishiro <rsinfu gmail.com> 2010-10-27 15:23:44 PDT
---
Expansion works inside dynamic array literals, but doesn't inside array
initializers.  The following works (both D1 & D2):

template Foo(Strings...)
{
    const a2 = ([Strings])[];  // as an array literal
}

alias Foo!("one", "two") foo;

*** This issue has been marked as a duplicate of issue 1064 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 27 2010