title: Can't use an "inline" array in C#?
body: <p>Imagine you have this somewhere</p>
  
  <pre><code>public static T AnyOne&lt;T&gt;(this T[] ra) where T:class
      {
      int k = ra.Length;
      int r = Random.Range(0,k);
      return ra[r];
      }
  </code></pre>
  
  <p>or even just this</p>
  
  <pre><code>public static string OneOf(this string[] strings)
      {
      return "a";
      }
  </code></pre>
  
  <p>Then, of course you can do this...</p>
  
  <pre><code>string[] st = {"a","b","c"};
  string letter = st.AnyOne();
  </code></pre>
  
  <p>... which is great.  BUT.  It would appear you can NOT do this:</p>
  
  <pre><code>string letter = {"a","b","c"}.AnyOne();
  </code></pre>
  
  <p>or indeed perhaps this</p>
  
  <pre><code>string letter = ( {"a","b","c"} ).AnyOne();
  </code></pre>
  
  <p>or anything else I tried.</p>
  
  <p>In fact (1) why can one not do that? and (2) am I missing something, how would you do that if there is a way?</p>