Thread overview
[Issue 4280] New: std.typecons.Tuple problem with one field
Aug 30, 2010
Andrej Mitrovic
June 06, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4280

           Summary: std.typecons.Tuple problem with one field
           Product: D
           Version: future
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2010-06-06 04:59:29 PDT ---
This D2 program looks correct:


import std.typecons: Tuple;
void main() {
    auto t = Tuple!(int)(1);
}



But DMD v2.046 prints at compile-time:

...\src\phobos\std\typecons.d(349): Error: no property 'Types' for type 'int'
Error: no property 'length' for type 'int'
...\src\phobos\std\typecons.d(349): Error: static assert  (0u == 1u) is false
test.d(3):        instantiated from here: __ctor!(int)


If tuples don't support a single item, then the docs have to say it, and it's better to produce a better error message.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 30, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4280


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2010-08-29 20:43:30 PDT ---
This works fine in 2.048.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 30, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4280


bearophile_hugs@eml.cc changed:

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


--- Comment #2 from bearophile_hugs@eml.cc 2010-08-29 23:31:16 PDT ---
Thank you. I close this, bug is fixed in 2.048.

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