[Issue 4280] New: std.typecons.Tuple problem with one field

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 6 04:59:30 PDT 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 at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at 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: -------


More information about the Digitalmars-d-bugs mailing list