Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cs1654.cs « errors « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b9b316ea09a8d554844a2ebff3a70b596f34da24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// cs1654.cs: Cannot assign to members of `p' because it is a `foreach iteration variable'
// Line: 18

using System.Collections;

struct P {
	public int x;
}

class Test {
	static IEnumerable foo () { return null; }

	static void Main ()
	{
		IEnumerable f = foo ();
		if (f != null)
			foreach (P p in f)
				p.x = 0;
	}
}