title: Why does the & operator in TypeScript filter union types but concats object types?
body: <p>I encountered the below code while learning TypeScript and I can't understand why the <code>&amp;</code> operator returns only <code>'apple'</code> when used with union types but seems to concatenate object types evidenced by it returning a union of <code>&quot;name&quot; | &quot;age&quot; | &quot;address&quot; | &quot;year&quot;</code> when getting the keys from the resultant type.</p>
  <pre class="lang-typescript prettyprint-override"><code>type fruits = 'apple' | 'pear' | 'tomato'
  type vegetables = 'spinach' | 'cabbage' | 'tomato';
  
  type gardenPlants = fruits &amp; vegetables;
  
  type Employee = { name: string; age: number }
  type Company = { name: string, address: string, year: number}
  
  type Info = keyof (Employee &amp; Company);
  </code></pre>