summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg/gdc15.d
blob: 935a42871f93fb8097dbdf2fa1be22f227c8f224 (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
// https://bugzilla.gdcproject.org/show_bug.cgi?id=15
// { dg-do compile }

template map(fun...)
{
    auto map(Range)(Range r)
    {
        return MapResult!(fun, Range)(r);
    }
}

private struct MapResult(alias fun, Range)
{
    Range _input;

    this(Range input)
    {
        _input = input;
    }
}

class B
{
    class A { }
    A a;
}

class C
{
    void visit(B b)
    {
        auto as = [b.a];
        map!((d) { return d; })(as);
    }
}