summaryrefslogtreecommitdiff
path: root/mcs/errors/cs0165-23.cs
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/errors/cs0165-23.cs')
-rw-r--r--mcs/errors/cs0165-23.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/mcs/errors/cs0165-23.cs b/mcs/errors/cs0165-23.cs
new file mode 100644
index 0000000000..8c947a2af5
--- /dev/null
+++ b/mcs/errors/cs0165-23.cs
@@ -0,0 +1,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 "";
+ }
+} \ No newline at end of file