title: Swift 5: 'self' used before 'self.init' call
body: <p>I'm trying to use a required convenience failable initializer. Here's the code I'm working with:</p>
  
  <pre class="lang-swift prettyprint-override"><code>public init(authState: OIDAuthState, config: [String: String], accessibility: CFString = kSecAttrAccessibleWhenUnlockedThisDeviceOnly) throws {
          self.authState = authState
          self.config = config
          self.accessibility = accessibility
  
          super.init()
  
          KeycloakAuth.configuration = config
      }
  
  public required convenience init?(coder aDecoder: NSCoder) {
          try? self.init(authState:     aDecoder.decodeObject(forKey: "authState")     as! OIDAuthState,
                         config:        aDecoder.decodeObject(forKey: "config")        as! [String: String],
                         accessibility: aDecoder.decodeObject(forKey: "accessibility") as! CFString)
      }
  </code></pre>
  
  <p>I get the error <code>'self' used before 'self.init' call</code> on the <code>public required...</code> line, and the same error again on the <code>try? self.init(...</code> line.</p>
  
  <p>I've looked at a few other related questions on Stack Overflow. Namely these:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/46062704/ios-swift-convenience-initializer-self-used-before-self-init-called">iOS Swift convenience initializer self used before self.init called</a></li>
  <li><a href="https://stackoverflow.com/questions/38881755/self-used-before-self-init-call-error-while-using-nscoding-on-a-custom-class">&#39;self&#39; used before self.init call error while using NSCoding on a custom class</a></li>
  </ol>
  
  <p>So I arranged my convenience init accordingly to try and return nil if there were any problems:</p>
  
  <pre class="lang-swift prettyprint-override"><code>public required convenience init?(coder aDecoder: NSCoder) {
          guard
              let authState     = aDecoder.decodeObject(forKey: "authState")     as? OIDAuthState,
              let config        = aDecoder.decodeObject(forKey: "config")        as? [String: String]
          else {
              print("KeycloakTokenManager: There was an error intializing authState or config")
              return nil
          }
  
          let accessibility = aDecoder.decodeObject(forKey: "accessibility") as! CFString
  
          try? self.init(authState: authState, config: config, accessibility: accessibility)
      }
  </code></pre>
  
  <p>But I'm getting same the errors on the same code (initializer, and call to <code>self.init</code>). Interestingly, my project built fine on Swift 4, but I haven't heard anything about this being a bug is Swift 5. How can I get rid of this error?</p>