summaryrefslogtreecommitdiff
path: root/mcs/errors/cs0165-23.cs
blob: 8c947a2af53dca26b38c866ce4e8038131c831bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// CS0165: Use of unassigned local variable `retval'
// Line: 9

class Test
{
	static string DoStuff (string msg)
	{
		string retval;

		switch (msg) {
		case "hello":
			retval = "goodbye";
			return retval;
		case "goodbye":
			return retval;
		case "other":
			retval = "other";
		case "":
			return msg;
		}
		return "";
	}
}