title: C# Pattern match arrays
body: <pre class="lang-cs prettyprint-override"><code>var x = new int[] { 1, 2 };
  var y = x switch {
    { 1, 2 } =&gt; &quot;yea&quot;,
    _ =&gt; &quot;nay&quot;
  };
  </code></pre>
  <p>fails to compile.</p>
  <p>How can I pattern-match arrays?</p>