[sgen] Don't trigger collections during allocation of thread objects (#17970)
[mono-project.git] / mcs / errors / cs1654-2.cs
blobbb0c242a8db426cfcf0f249ae6e0937974292557
1 // CS1654: 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;