title: Tuple with fixed length
body: <p>Typescript in tuple allows to add extra elements with any of types used before, but I would like to limit the length. I've tried with <code>&amp; { length: 2 }</code>, <a href="https://www.typescriptlang.org/play/#src=declare%20var%20a%3A%20%5Bstring%2C%20number%5D%20%26%20%7B%20length%3A%202%20%7D%3B%0D%0A%0D%0Aa%5B0%5D%20%3D%20%221%22%0D%0Aa%5B1%5D%20%3D%202%3B%0D%0Aa%5B2%5D%20%3D%20%223%22%3B%0D%0Aa%5B3%5D%20%3D%204%3B" rel="noreferrer">but it didn't helped</a>:</p>
  
  <pre><code>declare var a: [string, number] &amp; { length: 2 };
  
  a[0] = "1"
  a[1] = 2;
  a[2] = "3";
  a[3] = 4;
  </code></pre>
  
  <p>Assignments for <code>[2]</code> and <code>[3]</code> don't produce error. How can I specify corresponding type?</p>