D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8267 - called template only instantiated once with foreach over expression type tuple
Summary: called template only instantiated once with foreach over expression type tuple
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-19 09:11 UTC by Travis Gockel
Modified: 2013-11-26 09:01 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 Travis Gockel 2012-06-19 09:11:14 UTC
Take the following code:

    template Seq(T...) { alias T Seq; }

    auto exec(alias F)() { return F(); }

    void main()
    {
        foreach (x; Seq!(0, 1))
            static assert (exec!(() => x)() == x);
    }

This will fail with "Error: static assert  (0 == 1) is false" on DMD64 v2.059.
Comment 1 yebblies 2013-11-26 09:01:10 UTC
Works now.