title: Swift 4 : Cannot call value of non-function type '[Self.Element.Type]' when instantiating associated type array
body: <p>I was doing some exercises on Xcode 9 beta 2 Swift 4 from this article (<a href="https://www.uraimo.com/2016/01/06/10-Swift-One-Liners-To-Impress-Your-Friends/" rel="nofollow noreferrer">https://www.uraimo.com/2016/01/06/10-Swift-One-Liners-To-Impress-Your-Friends/</a>) when I came across an error while doing item no. 6:</p>
  
  <pre><code>extension Sequence{
     typealias Element = Self.Iterator.Element 
  
     func partitionBy(fu: (Element)-&gt;Bool)-&gt;([Element],[Element]){
         var first=[Element]() 
         var second=[Element]() 
         for el in self {
            if fu(el) { 
               first.append(el) 
            }else{ 
               second.append(el) 
            } 
         } 
         return (first,second) 
     } 
  }
  </code></pre>
  
  <p>Xcode 9 was throwing an error in the following lines:</p>
  
  <pre><code>   var first=[Element]() 
     var second=[Element]() 
  </code></pre>
  
  <p>The full error is below:</p>
  
  <pre><code>error: Swift-Playground.playground:6:29: error: cannot call value of non-function type '[Self.Element.Type]'
          var second=[Element]()
  </code></pre>
  
  <p>The error persists even if I remove the typealias and use the full <code>Self.Iterator.Element</code> type.</p>
  
  <p>This code works perfectly on Swift 3. I see no reason why it shouldn't work on Swift 4. Can someone help me out if it's a change in Swift 4 in terms of handling associated types and if so, what's the alternative to instantiate the array.</p>