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

22 lines
299 B
D

/* TEST_OUTPUT:
---
fail_compilation/test20610.d(20): Error: cannot modify `const` expression `field`
---
*/
// https://issues.dlang.org/show_bug.cgi?id=20610
struct S
{
int what;
}
void main()
{
S record;
foreach (const ref field; record.tupleof)
{
field = 10;
}
}