title: Issue with `Protocol can only be used as a generic constraint because it has Self or associated type requirements`
body: <p>I'm trying to generate a ViewModel that conforms to a Protocol <code>Protocoling</code>, the protocol is generic, and has an associated type.
  There are a few ViewModel's that conform to the protocol, so I am trying to create a factory for the viewModel.
  I have encotuntered the following error by Swift:
  <code>Protocol can only be used as a generic constraint because it has Self or associated type requirements</code>
  Example code:</p>
  
  <pre><code>protocol Protocoling {
      associatedtype modulingType
      var data: modulingType { get }
  }
  
  enum MyTypes {
      case myName
      case myAddress
  }
  
  class NameViewModel: Protocoling {
      let data: String
  
      init(name: String) {
          data = name
      }
  }
  
  class AddressViewModel: Protocoling {
      let data: [String]
      init(address: [String]) {
          data = address
      }
  }
  
  class DataFactory {
      func viewModel(forType type: MyTypes) -&gt; Protocoling {
          switch type {
              case .name: return NameViewModel(name: "Gil")
              case .address: return AddressViewModel(address: ["Israel", "Tel Aviv"])
          }
      }
  }
  </code></pre>
  
  <p>The error is in <code>func viewModel(forType type: MyTypes) -&gt; Protocoling</code>.</p>
  
  <p>Is there a way to solve this issue?</p>