blob: a0e4d69b361fb4d2603db4663c15299b5866b698 [file] [log] [blame]
/* REQUIRED_ARGS: -preview=dip1000
fail_compilation/test14238.d(20): Error: scope parameter `fn` may not be returned
fail_compilation/test14238.d(28): Error: escaping reference to stack allocated value returned by `&baz`
alias Fn = ref int delegate() return;
ref int foo(return scope Fn fn)
return fn(); // Ok
ref int foo2(scope Fn fn) {
return fn(); // Error
ref int bar() {
int x;
ref int baz() {
return x;
return foo(&baz);