dmd/compiler/test/fail_compilation/test22541.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

18 lines
423 B
D

/* REQUIRED_ARGS: -preview=dip1000
TEST_OUTPUT:
---
fail_compilation/test22541.d(104): Error: escaping a reference to parameter `i` by returning `i` is not allowed in a `@safe` function
fail_compilation/test22541.d(102): perhaps annotate the parameter with `return`
---
*/
/* https://issues.dlang.org/show_bug.cgi?id=22541
*/
#line 100
@safe
ref int newe(ref return scope int i) // ref, error
{
return i;
}