Summary: empty tuples not assignable: Error: tuple has no
                    effect in expression (tuple())
           Product: D
           Version: 1.051
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2009-12-13 17:29:20 PST ---
First off, this report is for 1.053, but I could select only up to 1.051.

Apparently empty tuples can't be assigned, thus creating special cases whenever
a tuple happens to have 0 elements.

The following code fails to compile and I think it shouldn't:

void foo(T...)(T a) {
    struct X {
        T a;
    X x;
    x.a = a;  //line 6

void test() {
    foo!(int)(0); //works
    foo!()();     //fails

void main() {}

Compilation fails with:

a.d(6): Error: tuple has no effect in expression (tuple())
a.d(11): Error: template instance!() error instantiating

Not sure how this is related to bug 3278 or bug 3600.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to