2010-05-31 Jb Evain <jbevain@novell.com>
[mcs.git] / errors / cs1654-2.cs
blob1305053eb43d561c0637aa7c144544f50f664a33
1 // cs1654-2.cs: Cannot assign to members of `q' because it is a `foreach iteration variable'
2 // Line: 22
4 using System.Collections;
6 struct P {
7 public int x;
10 struct Q {
11 public P p;
14 class Test {
15 static IEnumerable foo () { return null; }
17 static void Main ()
19 IEnumerable f = foo ();
20 if (f != null)
21 foreach (Q q in f)
22 q.p.x = 0;