dmd/compiler/test/fail_compilation/test12822.d
Dennis 9b94878c85
Make safe error messages consistent (#20654)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2025-01-08 13:46:38 +08:00

17 lines
401 B
D

/*
TEST_OUTPUT:
---
fail_compilation/test12822.d(13): Error: modifying delegate pointer `dg.ptr` is not allowed in a `@safe` function
fail_compilation/test12822.d(14): Error: using `dg.funcptr` is not allowed in a `@safe` function
---
*/
// https://issues.dlang.org/show_bug.cgi?id=12822
void test2(int delegate() dg) @safe
{
static int i;
dg.ptr = &i;
dg.funcptr = &func;
}
int func();