| 1 |
/* REQUIRED_ARGS: -preview=dip1000 |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/fail20691.d(106): Error: taking address of `scope` variable `sa` with pointers is not allowed in a `@safe` function |
| 5 |
fail_compilation/fail20691.d(107): Error: taking address of `scope` variable `sa` with pointers is not allowed in a `@safe` function |
| 6 |
fail_compilation/fail20691.d(108): Error: taking address of `scope` variable `sa` with pointers is not allowed in a `@safe` function |
| 7 |
--- |
| 8 |
*/ |
| 9 |
|
| 10 |
#line 100 |
| 11 |
|
| 12 |
// https://issues.dlang.org/show_bug.cgi?id=20691 |
| 13 |
|
| 14 |
void bar() @safe |
| 15 |
{ |
| 16 |
scope char[][2] sa; |
| 17 |
scope char[][] da = cast(char[][])sa; |
| 18 |
scope char[][] ca = sa; |
| 19 |
foo(sa); |
| 20 |
} |
| 21 |
|
| 22 |
void foo(scope char[][] a) @safe; |