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

14 lines
264 B
D

/*
TEST_OUTPUT:
---
fail_compilation/fail20658.d(14): Error: modifying field `U.m` which overlaps with fields with other storage classes is not allowed in a `@safe` function
---
*/
union U
{
int m;
immutable int i;
}
U u;
enum e = () @safe { u.m = 13; };