title: Is it possible to get the type of variable to be assigned via reflection?
body: <p>I was wondering something like the the following is possible</p>
  <pre><code>int foo = GetDefaultValue();
  
  object GetDefaultValue() // Example function, behavior is not the purpose of this question
  {
      Type t = // Reflection magic
      if (t.IsValueType)
          return Activator.CreateInstance(t);
  
      return null;
  }
  </code></pre>
  <p>I know something similar exists with the <code>CallerMemberNameAttribute</code> attribute, but it doesn't give me what I'm looking for.</p>
  <p>I know I can use generics, pass type as parameter etc, but I was curious if it's possible with reflection (just curiosity)</p>