mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
21 lines
537 B
D
21 lines
537 B
D
/* REQUIRED_ARGS: -preview=dip1000
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/test17959.d(18): Error: assigning scope variable `this` to non-scope `this.escape` is not allowed in a `@safe` function
|
|
fail_compilation/test17959.d(19): Error: assigning scope variable `this` to non-scope `this.f` is not allowed in a `@safe` function
|
|
---
|
|
*/
|
|
|
|
// https://issues.dlang.org/show_bug.cgi?id=17959
|
|
|
|
class Foo
|
|
{
|
|
void delegate () @safe escape;
|
|
Foo f;
|
|
|
|
void escfoo() @safe scope
|
|
{
|
|
this.escape = &this.escfoo;
|
|
f = this;
|
|
}
|
|
}
|