summaryrefslogtreecommitdiff
path: root/mcs/errors/cs0165-52.cs
blob: 904f7db487b0eff999f302d7d71784e10f04543f (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
// CS0165: Use of unassigned local variable `x'
// Line: 21

using System;

class X
{
	static bool Foo (out int x)
	{
		x = 5;
		return false;
	}

	public static int Main ()
	{
		int x;
		try {
			throw new ApplicationException ();
		} catch when (Foo (out x)) {
			return 1;
		} catch when (x > 0) {
			return 0;
		}
	}
}