aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/pr9383.d
blob: ca6d70fa2e6d4c972ec45b0ba5a43bd5f5c34cf7 (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
// REQUIRED_ARGS: -preview=dip1000
// https://github.com/dlang/dmd/pull/9383

void test() @safe
{
    int[1] a = [1];
    cartesianProduct(a[]);
}

auto cartesianProduct(RR...)(RR ranges)
{
    static struct Result
    {
        RR current;

        void popFront() scope @safe
        {
            foreach (ref r; current)
            {
            }
        }
    }

    return Result(ranges);
}