www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3614] New: empty tuples not assignable: Error: tuple has no effect in expression (tuple())

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

           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
        AssignedTo: nobody puremagic.com
        ReportedBy: nfxjfg gmail.com


--- Comment #0 from nfxjfg gmail.com 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 a.foo!() error instantiating

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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 13 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3614


nfxjfg gmail.com changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 06 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3614


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |braddr puremagic.com
         Resolution|WONTFIX                     |


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