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

22 lines
397 B
D

/*
REQUIRED_ARGS: -de
TEST_OUTPUT:
---
fail_compilation/systemvariables_bool_union.d(21): Deprecation: accessing overlapped field `Box.b` with unsafe bit patterns will become `@system` in a future release
---
*/
// https://issues.dlang.org/show_bug.cgi?id=24477
bool schrodingersCat() @safe
{
union Box
{
bool b;
ubyte y;
}
Box u;
u.y = 2;
return u.b;
}