title: Cannot invoke an expression whose type lacks a call signature
body: <p>I have apple and pears - both have an <code>isDecayed</code> attribute:</p>
  
  <pre><code>interface Apple {
      color: string;
      isDecayed: boolean;
  }
  
  interface Pear {
      weight: number;
      isDecayed: boolean;
  }
  </code></pre>
  
  <p>And both types can be in my fruit basket (multiple times):</p>
  
  <pre><code>interface FruitBasket {
     apples: Apple[];
     pears: Pear[];
  }
  </code></pre>
  
  <p>Let's assume for now my basket is empty:</p>
  
  <pre><code>const fruitBasket: FruitBasket = { apples: [], pears: [] };
  </code></pre>
  
  <p>Now we take randomly one kind out of the basket:</p>
  
  <pre><code>const key: keyof FruitBasket = Math.random() &gt; 0.5 ? 'apples': 'pears'; 
  const fruits = fruitBasket[key];
  </code></pre>
  
  <p>And of course nobody likes decayed fruits so we pick only the fresh ones:</p>
  
  <pre><code>const freshFruits = fruits.filter((fruit) =&gt; !fruit.isDecayed);
  </code></pre>
  
  <p>Unfortunately Typescript tells me:</p>
  
  <blockquote>
    <p>Cannot invoke an expression whose type lacks a call signature. Type '((callbackfn: (value: Apple, index: number, array: Apple[]) => any, thisArg?: any) => Apple[]) | ...' has no compatible call signatures.</p>
  </blockquote>
  
  <p>What's wrong here - is it just that Typescript doesn't like fresh fruits or is this a Typescript bug?</p>
  
  <p>You can try it yourself in the official <a href="https://www.typescriptlang.org/play/#src=interface%20Apple%20%7B%0D%0A%20%20%20%20color%3A%20string%3B%0D%0A%20%20%20%20isDecayed%3A%20boolean%3B%0D%0A%7D%0D%0A%0D%0Ainterface%20Pear%20%7B%0D%0A%20%20%20%20weight%3A%20number%3B%0D%0A%20%20%20%20isDecayed%3A%20boolean%3B%0D%0A%7D%0D%0A%0D%0Ainterface%20FruitBasket%20%7B%0D%0A%20%20%20%20apples%3A%20Apple%5B%5D%3B%0D%0A%20%20%20%20pears%3A%20Pear%5B%5D%3B%0D%0A%7D%0D%0A%0D%0A%0D%0Aconst%20fruitBasket%3A%20FruitBasket%20%3D%20%7B%20apples%3A%20%5B%5D%2C%20pears%3A%20%5B%5D%20%7D%3B%0D%0Aconst%20key%3A%20keyof%20FruitBasket%20%3D%20Math.random()%20%3E%200.5%20%3F%20&#39;apples&#39;%3A%20&#39;pears&#39;%3B%20%0D%0Aconst%20fruits%20%3D%20fruitBasket%5Bkey%5D%3B%0D%0A%0D%0Aconst%20freshFruits%20%3D%20fruits.filter((fruit)%20%3D%3E%20!fruit.isDecayed)%3B" rel="noreferrer">Typescript Repl</a>.</p>