title: How to fix `Value of type '[ReceiptInfo]' (aka ...) has no member 'compactMap'`?
body: <p>I'm working on a project which is build on Swift3, then upgraded to Swift 4. By switching <code>Toolchain &gt; Swift Development Snapshot</code> to <code>XCode 9.2</code>, XCode shows 3 errors related to <code>compactMap</code>:</p>
  
  <p>ERROR: Value of type '[ReceiptInfo]' (aka 'Array>') has no member 'compactMap'</p>
  
  <pre><code>let receiptItems = nonCancelledReceiptsInfo.compactMap { ReceiptItem(receiptInfo: $0) }
  
  return receiptItems.compactMap {
      if let expirationDate = $0.subscriptionExpirationDate {
         return (expirationDate, $0)
      }
         return nil
  }
  </code></pre>
  
  <p>Unfortunately I don't know so much about XCode and Swift. I need the equivalent Swift 4 code of it. I appreciate any kind help.</p>