title: Why does A | B allow a combination of both, and how can I prevent it?
body: <p>I was surprised to find that TypeScript won't complain at me doing something like this:</p>
  <pre><code>type sth = { value: number, data: string } | { value: number, note: string };
  const a: sth = { value: 7, data: 'test' };
  const b: sth = { value: 7, note: 'hello' };
  const c: sth = { value: 7, data: 'test', note: 'hello' };
  </code></pre>
  <p>I thought maybe <code>value</code> was picked out as a type union discriminant or something, because the only thing that I could come up with to explain this was if TypeScript somehow understood <code>number</code> here to be a superset of <code>1 | 2</code> for example.</p>
  <p>So I changed <code>value</code> to be <code>value2</code> on the second object:</p>
  <pre><code>type sth = { value: number, data: string } | { value2: number, note: string };
  const a: sth = { value: 7, data: 'test' };
  const b: sth = { value2: 7, note: 'hello' };
  const c: sth = { value: 7, data: 'test', note: 'hello' };
  </code></pre>
  <p>Still, no complaint, and I'm able to construct <code>c</code>. IntelliSense breaks down on <code>c</code> though, it won't suggest anything when I <code>.</code> into it. Same if I change <code>value</code> in <code>c</code> to be <code>value2</code>.</p>
  <p>Why doesn't this produce an error? Clearly, I have failed to provide one type or the other and instead provided a weird mix of both!</p>