title: Property 'toDate' does not exist on type 'FieldValue | Timestamp' but WORKS
body: <p>I'm using Cloud Firestore to store Chats, which I would like to sort by lastestMessage.created. I was not able to use the query because I was using it for something else so I'm using the SORT function to do it.</p>
  
  <p>I keep getting this error on VS Code: </p>
  
  <p>Property 'toDate' does not exist on type 'FieldValue | Timestamp'.</p>
  
  <p>However, the code runs just fine, it compares it and returns it correctly. With no errors in the console.</p>
  
  <pre><code>      chats.sort(function (a, b) {
          if (b.latestMessage.created &amp;&amp; a.latestMessage.created) {
            return b.latestMessage.created.toDate() - a.latestMessage.created.toDate();
          }
        });
  
  
  (parameter) a: {
      contractId?: string;
      members: any;
      contact: any;
      latestMessage?: Message;
      id?: string;
      created?: firebase.firestore.FieldValue | firebase.firestore.Timestamp;
      modified?: firebase.firestore.FieldValue | firebase.firestore.Timestamp;
  }
  </code></pre>
  
  <p>It's just annoying that this false ERROR keeps showing when I compile and that it works perfectly...</p>