title: Calling a protocol extension initializer
body: <p>I'm trying to build a set of classes that would share common initializing code. Apart from inheritance, I thought protocols would be the way to go. While protocols and protocol extensions worked for me with instance and static methods, I have some troubles making it work with initializers.</p>
  
  <p>Let's say we have this protocol:</p>
  
  <pre><code>protocol CloudServiceWrapper {
  
      static var isConfigured: Bool { get }
  
      init()
  
      func initialize()
  
  }
  </code></pre>
  
  <p>Now let's say we want to add default implementations for both <code>isConfigured</code> and <code>init()</code> in a protocol extension:</p>
  
  <pre><code>extension CloudServiceWrapper {
  
      static var isConfigured: Bool {
          get {
              return true
          }
      }
  
      init() {
          print("Initializing generic CloudServiceWrapper")
          self.init()
          if Self.isConfigured {
              initialize()
          }
  
      }
  
  }
  </code></pre>
  
  <p>Finally, let's have a class implementing this protocol and trying to benefit from its default implementations:</p>
  
  <pre><code>class OneDriveWrapper: CloudServiceWrapper {
  
      required init() {
          // CloudServiceWrapper() // error: protocol type 'CloudServiceWrapper' cannot be instantiated
          // self = CloudServiceWrapper.init() // error: cannot assign to value: 'self' is immutable
          // super.init() // error: 'super' members cannot be referenced in a root class
          // (self as CloudServiceWrapper).init() // error: static member 'init' cannot be used on instance of type 'CloudServiceWrapper'
          print("Initializing OneDriveWrapper")
      }
  
      func initialize() {
          print("Done")
      }
  
  }
  </code></pre>
  
  <p>When trying to build a new instance of the <code>OneDriveWrapper</code> class, there's simply no way I could find to both call the class' initializer, and the default protocol implementation. And it is not possible to omit the <code>init()</code> in the <code>OneDriveWrapper</code> class, since it is required per the protocol definition, and seemingly not considered "implemented" with the protocol extension.</p>
  
  <p>In fact, more broadly, I couldn't find any way to <em>explicitly</em> call a protocol extension's initializer, even though I know it's possible for instance methods.</p>
  
  <p>What am I doing wrong? Do you know any way of combining both the class' initialiser and the protocol extension's one? Should I fall back to class inheritance instead of protocols and extensions?</p>
  
  <p>Thanks! </p>