summaryrefslogtreecommitdiff
path: root/mcs/errors/cs1612-5.cs
blob: 1db5cb158cd6d443285072953aff65fbfea64c4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// CS1612: Cannot modify a value type return value of `bar.this[int]'. Consider storing the value in a temporary variable
// Line: 19

struct foo {
	public int x;
}

class bar {
	public foo this [int x] {
		get { return new foo (); }
		set { }
	}
}

class main {
	static void baz (out int x) { x = 5; }
	static void Main ()
	{
		bar b = new bar ();
		baz (out b [0].x);
	}
}