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

cs1649.cs « errors « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bd14b2d995998b3e3e12890fa6a3aa618dc7d372 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// cs1649.cs: Members of readonly field 'B.a' cannot be passed ref or out (except in a constructor)
// Line: 13

class B
{
	public struct A
	{
	    public int val;
	}

	public readonly A a = new A ();
}

class C
{
    static void f (ref int i)
    {
	i = 44;
    }

    static void Main ()
    {
	B b = new B (); 
	f (ref b.a.val);
    }
}