mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
16 lines
408 B
D
16 lines
408 B
D
/* REQUIRED_ARGS: -preview=dip1000
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/test22227.d(12): Error: returning scope variable `foo` is not allowed in a `@safe` function
|
|
fail_compilation/test22227.d(14): Error: returning scope variable `foo` is not allowed in a `@safe` function
|
|
---
|
|
*/
|
|
|
|
int[] foo() @safe
|
|
{
|
|
if (scope foo = [1])
|
|
return foo;
|
|
while (scope foo = [1])
|
|
return foo;
|
|
return [];
|
|
}
|