mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
22 lines
299 B
D
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;
|
|
}
|
|
}
|