title: Cast not required in typescript when using instanceof?
body: <p>I am using <code>instanceof</code> to check if an object is of a certain type.
  I would expect that if this is true, I'd still need to cast that object to that certain type before I can use it as such. </p>
  
  <p>But instead, inside the IF statement a cast seems not to be necessary. At least not in Visual Studio Code and in the <a href="http://www.typescriptlang.org/play/" rel="nofollow noreferrer">Typescript Playground</a>.</p>
  
  <pre><code>class Drink { 
      price: number = 4;
  }
  
  class Beer extends Drink { 
      alcohol: number = 6;
  }
  
  let array: Array&lt;Drink&gt; = new Array&lt;Drink&gt;();
  array.push(new Drink(), new Beer(), new Drink());
  
  for (let g of array) { 
      // here, only 'price' is available as a property of drink
      console.log(g.price);
      if (g instanceof Beer) {    
          // but unexpectedly, inside the IF statement
          // the alcohol value IS available!
          console.log(g.alcohol);
  
          // I expected I needed to cast drink to beer first:
          console.log((&lt;Beer&gt;g).alcohol);  
      }
  }
  </code></pre>
  
  <p>Is this very smart behavior of the Typescript editor or is this a glitch?</p>
  
  <p>Copy>Paste the above code in the <a href="http://www.typescriptlang.org/play/" rel="nofollow noreferrer">Typescript Playground</a> to see this behavior...</p>