title: How can i find the value of a variable through roslyn
body: <p>I am making a Diagnostic Analyzer using Roslyn. I want to get the value of a variable in the code which is being analyzed. 
  Such as getting the value of the variable <code>num</code> in this code:</p>
  
  <pre><code>int[] a = { 1, 2, 3 };
  int[] num = a;
  Person person1 = new Person("bob", num);
  </code></pre>
  
  <p>I have tried compiling the code on the fly by creating a new Compilation Unit,</p>
  
  <pre><code>SyntaxTree compilationUnitTree = SyntaxTree.ParseText(
              @"using System;
               namespace HelloWorld
              {
                  class Program
                  {
                      static void Main(string[] args)
                      {
                          int[] a = { 1, 2, 3 };
                          int[] num = a;
                      }
                  }
              }");
   var compilation = CSharpCompilation.Create("MyCompilation", syntaxTrees: new[] { compilationUnitTree });
   var semanticModel = compilation.GetSemanticModel(compilationUnitTree);
  </code></pre>
  
  <p>But I was unable to get its value.
  I have also tried using DataFlowAnalysis of SemanticModel, I am able to successfully check properties such as if the value is constant or not etc. but when I check for value of <code>num</code> it gives <code>a</code> and not what I expected({1,2,3}).</p>
  
  <p>Is there any way I can get the value of a variable using Roslyn?</p>