dmd/compiler/test/fail_compilation/safer.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
305 B
D

/* REQUIRED_ARGS: -preview=safer
TEST_OUTPUT:
---
fail_compilation/safer.d(10): Error: `void` initializing a pointer is not allowed in a function with default safety with `-preview=safer`
---
*/
void test1()
{
int* p = void;
}
void foo3() { }
void test2()
{
foo3(); // should not be an error
}