--- /dev/null
+// CS0165: Use of unassigned local variable `j'
+// Line: 10
+
+class Test
+{
+ static void Main ()
+ {
+ int? i;
+ int? j;
+ int? x = (i = 7) ?? j;
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0165: Use of unassigned local variable `a'
+// Line: 9
+
+using System;
+
+class Test {
+
+ static void Main () {
+ Action a = () => a();
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0165: Use of unassigned local variable `i'
+// Line: 9
+
+public class MainClass
+{
+ public void Foo ()
+ {
+ int i;
+ i++;
+ }
+}
--- /dev/null
+// CS0165: Use of unassigned local variable `a'
+// Line: 9
+
+class C
+{
+ static void Main ()
+ {
+ int a;
+ Foo (out a, a);
+ }
+
+ static void Foo (out int a, int b)
+ {
+ a = b;
+ }
+}
\ No newline at end of file
public void FlowAnalysis (FlowAnalysisContext fc)
{
- foreach (var arg in args)
+ bool has_out = false;
+ foreach (var arg in args) {
+ if (arg.ArgType == Argument.AType.Out) {
+ has_out = true;
+ continue;
+ }
+
arg.FlowAnalysis (fc);
+ }
+
+ if (!has_out)
+ return;
+
+ foreach (var arg in args) {
+ if (arg.ArgType != Argument.AType.Out)
+ continue;
+
+ arg.FlowAnalysis (fc);
+ }
}
public List<Argument>.Enumerator GetEnumerator ()