mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
29 lines
406 B
D
29 lines
406 B
D
// PERMUTE_ARGS: -preview=dip1000
|
|
|
|
// https://issues.dlang.org/show_bug.cgi?id=20596
|
|
|
|
struct S(T)
|
|
{
|
|
void delegate() dg;
|
|
|
|
this(scope void delegate() dg)
|
|
{
|
|
this.dg = dg;
|
|
}
|
|
}
|
|
|
|
@nogc void fooTemplate()
|
|
{
|
|
int num;
|
|
|
|
void foo() { int dummy = num; }
|
|
|
|
scope s = S!int(&foo);
|
|
}
|
|
|
|
void test3032() @nogc
|
|
{
|
|
int n = 1;
|
|
scope fp = (){ n = 10; }; // no closure
|
|
fp();
|
|
}
|