title: Assign subprotocol as an associated type
body: <p>Here is a simplified version of what I am trying to do</p>
  
  <pre class="lang-swift prettyprint-override"><code>protocol ThemeManager {
      associatedType ThemeClass: Theme
      var sharedTheme: ThemeClass { get }
  }
  
  protocol Theme {
     // ...
  }
  
  protocol AppTheme: Theme {
      var viewTheme: AppSpecificViewTheme { get set }
  }
  
  final class ThemeManager: Framework.ThemeManager {    
      var sharedTheme: AppTheme
  }
  </code></pre>
  
  <p>The <code>ThemeManager</code> protocol lives in a external framework that I made to share between 2 apps, but now I want to add app-specific theme variables into the <code>Theme</code> protocol for all my Theme classes to add. <code>ThemeManager</code> class which lives in the app is failing to build if I use <code>AppTheme</code> protocol, but successfully build by passing in a concrete <code>Theme</code> class. Is there a way to make this work?</p>
  
  <p>Edit:
  I found this other question on SO that asks the same thing, with an explanation as to why this won't work. The explanation makes sense, but I'm still not sure why I can't define the protocol more since everything that conforms to <code>AppTheme</code> also conforms to <code>Theme</code>. My current workaround until I find a more permanent solution is just casting to <code>AppTheme</code> when needed.</p>