aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg/gdc122.d
blob: 0f2feef30c9d8791953dff5cd6deb50c0b17da62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// https://bugzilla.gdcproject.org/show_bug.cgi?id=122
// { dg-do compile }

struct map(alias fun)
{
    @property run()
    {
    }
}

struct Task(Args)
{
    Args _args;
}

class TaskPool
{
    template reduce(functions...)
    {
        auto reduce(Args)(Args args)
        {
            alias RTask = Task!(typeof(args));
            auto task = RTask();
        }
    }
}

TaskPool taskPool() {
    return new TaskPool;
}

void test122()
{
    enum delta = 1;
    taskPool.reduce!"a + b"(map!({ immutable x = delta; })());
}