2 PERMUTE_ARGS: -preview=dip1000
5 fail_compilation/test21912.d(28): Error: function `test21912.escapeParam` is `@nogc` yet allocates closure for `escapeParam()` with the GC
6 fail_compilation/test21912.d(30): delegate `test21912.escapeParam.__lambda2` closes over variable `i`
7 fail_compilation/test21912.d(28): `i` declared here
8 fail_compilation/test21912.d(33): Error: function `test21912.escapeAssign` is `@nogc` yet allocates closure for `escapeAssign()` with the GC
9 fail_compilation/test21912.d(35): delegate `test21912.escapeAssign.__lambda3` closes over variable `i`
10 fail_compilation/test21912.d(33): `i` declared here
11 fail_compilation/test21912.d(44): Error: function `test21912.escapeAssignRef` is `@nogc` yet allocates closure for `escapeAssignRef()` with the GC
12 fail_compilation/test21912.d(46): delegate `test21912.escapeAssignRef.__lambda3` closes over variable `i`
13 fail_compilation/test21912.d(44): `i` declared here
14 fail_compilation/test21912.d(55): Error: function `test21912.escapeParamInferred` is `@nogc` yet allocates closure for `escapeParamInferred()` with the GC
15 fail_compilation/test21912.d(57): delegate `test21912.escapeParamInferred.__lambda2` closes over variable `i`
16 fail_compilation/test21912.d(55): `i` declared here
21 alias Dg
= @nogc int delegate();
23 Dg
identity(return scope Dg dg
)
30 return identity(() => i
);
33 Dg
escapeAssign(int i
, return scope Dg dg
)
39 ref Dg
identityR(return ref scope Dg dg
)
44 ref Dg
escapeAssignRef(int i
, return ref scope Dg dg
)
50 auto identityInferred(Dg dg
)
55 Dg
escapeParamInferred(int i
)
57 return identityInferred(() => i
);