title: Composing types In Typescript - Property does not exist on type
body: <p>I'm new to typescript and I'm failing to understand type composition when using objects.</p>
  <p>I have the following code :</p>
  <pre class="lang-js prettyprint-override"><code>export interface Foo {
    birth: Date;
  }
  
  export interface Bar {
    death: Date
  }
  
  export type Baz = Foo | Bar
  </code></pre>
  <p>Why is it that, if I have a <code>Baz</code> typed object, I can't do the following</p>
  <pre class="lang-js prettyprint-override"><code>const something = mybaz.birth; // Property birth does not exist on type Baz
  </code></pre>
  <p>How do I correctly solve this problem ?</p>
  <p>My goal is to end up with something like this :</p>
  <pre class="lang-js prettyprint-override"><code>const something = mybaz.birth ? mybaz.birth : mybaz.death;
  </code></pre>