2010-04-03 Jb Evain <jbevain@novell.com>
[mcs.git] / errors / cs1655.cs
blob7f653da362f65d9d36418a92c91c94af2905c32a
1 // cs1655.cs: Cannot pass members of `q' as ref or out arguments because it is a `foreach iteration variable'
2 // Line: 23
4 using System.Collections;
6 struct P {
7 public int x;
10 struct Q {
11 public P p;
14 class Test {
15 static void bar (out int x) { x = 0; }
16 static IEnumerable foo () { return null; }
18 static void Main ()
20 IEnumerable f = foo ();
21 if (f != null)
22 foreach (Q q in f)
23 bar (out q.p.x);