aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/test20821.d
blob: c0182977c3d6cad55dc3349e332f499414f1e9b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// https://issues.dlang.org/show_bug.cgi?id=20821

struct S
{
    int gun()(int i) { return 0; }
    alias fun = gun;
    int fun() { return 1; }

    static int sgun()(int i) { return 0; }
    alias sfun = sgun;
    static int sfun() { return 1; }
}

static assert(S().fun == 1); // expressionsem.d changes
static assert(S.sfun == 1);  // ditto

static assert(__traits(getOverloads, S, "fun", true).length == 2); // traits.d changes