Merge pull request #4926 from BrzVlad/fix-tls-v5
[mono-project.git] / mcs / errors / cs1655.cs
blobac6c22aa0f60932210112da636378557139d7319
1 // CS1655: 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);