Thread overview
[Issue 3451] New: Initializers don't work for tuple variables
Oct 29, 2009
Don
Oct 29, 2009
Don
[Issue 3451] (D1 only) Initializers don't work for tuple variables
Feb 04, 2012
yebblies
October 29, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3451

           Summary: Initializers don't work for tuple variables
           Product: D
           Version: 2.035
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: clugdbug@yahoo.com.au


--- Comment #0 from Don <clugdbug@yahoo.com.au> 2009-10-29 08:39:03 PDT ---
Variables of tuple type can be used in assignments, but not anywhere else (including initialization). And the error message is quite terrible.

void foo(T...)(T x) {
   T a;
   T b;
   a = x; // ok
   b = x; // ok
   T c = x; // fails
}

void main() {
   foo(1,2,3);
}
---
test.d(6): Error: cannot implicitly convert expression (tuple(_param_0,_param
1,_param_2)) of type (int, int, int) to int

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 29, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3451


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.035                       |1.030


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2009-10-29 08:42:27 PDT ---
Applies to D1 as well. In 1.020 and earlier, the assignment was rejected. The current behaviour dates from 1.028 or earlier.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 04, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3451


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies@gmail.com
           Platform|Other                       |All
            Version|1.030                       |D1
            Summary|Initializers don't work for |(D1 only) Initializers
                   |tuple variables             |don't work for tuple
                   |                            |variables
         OS/Version|Windows                     |All


--- Comment #2 from yebblies <yebblies@gmail.com> 2012-02-04 18:43:24 EST ---
D1 only, works in current D2 (2.058)

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