blob: 66a81c35613811536b5d6051aec7d8bf31a57d7d [file] [log] [blame]
/* REQUIRED_ARGS: -preview=dip1000
TEST_OUTPUT:
---
fail_compilation/test17423.d(26): Error: reference to local `this` assigned to non-scope parameter `dlg` calling test17423.Bar.opApply
---
*/
// https://issues.dlang.org/show_bug.cgi?id=17423
struct Bar
{
int delegate(int) @safe myDlg;
auto opApply(int delegate(int) @safe dlg) @safe {
myDlg = dlg;
return 0;
}
}
struct Foo
{
Bar o;
int i = 3;
this(int x) @safe {
foreach(_; o) { i = 0; }
i = x;
}
}