title: Command failed due to signal: Segmentation fault: 11 | Xcode 7.2
body: <p>I was asked to migrate a rather large app to Swift 2. The compiler keeps throwing segmentation fault: 11 errors for one function, present in different modules of the app's logic (only difference being variables used):</p>
  
  <pre><code>func loadMoreContent() {
  
  if let collection = self.ratingsCollection where collection.identifier != 0,
    let totalEntries = collection.totalEntries,
    let objects = self.ratings?.count where objects &lt; totalEntries {
  
      self.ratingsCollection = nil
  
      collection.nextPage().onSuccess { (value) in
  
        if let collection = value as? Collection&lt;Rating&gt; {
          self.ratingsCollection = collection
        } else {
          self.ratingsCollection = Collection&lt;Rating&gt;(identifier: 0)
        }
  
        }.onFailure { error in
          self.ratingsCollection = Collection&lt;Rating&gt;(identifier: 0)
      }
    }
  }
  </code></pre>
  
  <p>Here are the errors themselves:</p>
  
  <pre><code>1.  While type-checking 'loadMoreContent' at (path redacted).swift:46:3
  2.  While type-checking expression at [(path redacted).swift:54:9 - line:64:9] 
      RangeText="collection.nextPage().onSuccess { (value) in
  
                if let collection = value as? Collection&lt;Rating&gt; {
                  self.ratingsCollection = collection
                } else {
                  self.ratingsCollection = Collection&lt;Rating&gt;(identifier: 0)
                }
  
                }.onFailure { error in
                  self.ratingsCollection = Collection&lt;Rating&gt;(identifier: 0)
              }"
  
  3.  While loading members for declaration 0x7fdda42ea2b0 at &lt;invalid loc&gt;
  4.  While deserializing 'producer' (FuncDecl #340) 
  </code></pre>
  
  <p>Does anyone have any idea what can be wrong with this function at first glance? I should add it compiles with no changes in Xcode 6 / Swift 1.2.</p>