D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4280 - std.typecons.Tuple problem with one field
Summary: std.typecons.Tuple problem with one field
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-06 04:59 UTC by bearophile_hugs
Modified: 2015-06-09 05:13 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2010-06-06 04:59:29 UTC
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.
Comment 1 Andrej Mitrovic 2010-08-29 20:43:30 UTC
This works fine in 2.048.
Comment 2 bearophile_hugs 2010-08-29 23:31:16 UTC
Thank you. I close this, bug is fixed in 2.048.