a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
25 lines
351 B
C#
25 lines
351 B
C#
// CS1654: Cannot assign to members of `q' because it is a `foreach iteration variable'
|
|
// Line: 22
|
|
|
|
using System.Collections;
|
|
|
|
struct P {
|
|
public int x;
|
|
}
|
|
|
|
struct Q {
|
|
public P p;
|
|
}
|
|
|
|
class Test {
|
|
static IEnumerable foo () { return null; }
|
|
|
|
static void Main ()
|
|
{
|
|
IEnumerable f = foo ();
|
|
if (f != null)
|
|
foreach (Q q in f)
|
|
q.p.x = 0;
|
|
}
|
|
}
|