aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/ice12956.d
blob: 69d182e4fa52002355c91a440ee1be2e4fdd7e9c (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
// REQUIRED_ARGS: -o-
// PERMUTE_ARGS:

template isCallable(T...)
{
    static if (is(typeof(& T[0].opCall) == delegate))
    {
        enum bool isCallable = true;
    }
    else static if (is(typeof(& T[0].opCall) V : V*) && is(V == function))
    {
        enum bool isCallable = true;
    }
    else
        enum bool isCallable = false;
}

@property auto injectChain(Injectors...)()
{
    return &ChainTemplates!(Injectors);
}

template ChainTemplates(Templates...)
{
    alias Head = Templates[0];
    alias Tail = Templates[1..$];
    alias Head!(Tail) ChainTemplates;
}

static assert(!isCallable!(injectChain));