dmd/compiler/test/compilable/test22919.d
2022-07-09 18:53:07 +02:00

17 lines
359 B
D

// REQUIRED_ARGS: -checkaction=context -preview=dip1000
// Issue 22919 - [dip1000] -checkaction=context gives "assigned to `__assertOp2` with longer lifetime" (
// https://issues.dlang.org/show_bug.cgi?id=22919
@safe:
struct S
{
int* p;
ref S get() scope return {return this;}
}
void main()
{
scope S arr = S();
assert(arr == arr.get());
}