D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10458 - tuple of struct with unused member function
Summary: tuple of struct with unused member function
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-23 23:21 UTC by callumenator
Modified: 2014-04-24 12:12 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 callumenator 2013-06-23 23:21:38 UTC
http://forum.dlang.org/thread/odqtleucashpjekvtjsv@forum.dlang.org
DMD 2.063
Ali Çehreli's test case:

import std.typecons;

struct S
{
    int x;

    // Bizarre: Comment-out this function to pass the assert in main.
    Tuple!(S) unused()
    {
        return tuple(S(7));
    }
}

void main()
{
    auto s = S(8);
    assert(tuple(s).expand[0] == S(8));
}
Comment 1 Andrej Mitrovic 2014-04-24 12:12:33 UTC
Seems to work since 2.065.