blob: 55e7c639dd4783f3ba7e6007d9cd1c156df0ee6c [file] [log] [blame]
/* TEST_OUTPUT:
REQUIRED_ARGS: -preview=dip1000
---
fail_compilation/test22145.d(115): Error: scope variable `x` assigned to global variable `global`
---
*/
// issues.dlang.org/show_bug.cgi?id=22145
#line 100
struct S
{
int opApply (scope int delegate (scope int* ptr) @safe dg) @safe
{
return 0;
}
}
void test() @safe
{
static int* global;
S s;
foreach (scope int* x; s)
{
global = x;
}
}