title: Declare property of protocol shows Protocol can only be used as a generic constraint because it has Self or associated type requirements
body: <p>I am stuck in situation where I could not able to find solution. Seen many similar question but could't able to figure it out.</p>
  
  <p>So I have one View Controller which shows table view list for two types</p>
  
  <p>1) Sales <br>
  2) Purchase </p>
  
  <p>And I have decided to use same View Controller for both</p>
  
  <pre><code>enum SalesRowType {
      case salesOrderBooking
      case salesInvoicing
      case salesGrossContribution
  }
  
  enum PurchaseRowType {
      case purchaseOrders
      case amended_non_amended
      case pending_grn_po
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>// BASE PROTOCOL
   // ListRowType -&gt; has title,image property 
  protocol HomeSubItemType:ListRowType {
      associatedtype RowType
      var type:RowType {get}
  }
  // PURCHASE ITEMS
  
  struct PurchaseSubItem: HomeSubItemType {
  
      typealias RowType = PurchaseRowType
  
      var image: UIImage
      var title: String
      var type: PurchaseRowType
  }
  // SALES ITEMS
  struct SalesSubItem : HomeSubItemType {
      var image:UIImage
      var title:String
      var type:SalesRowType
  }
  </code></pre>
  
  <p>In My View Controller I want to create array  as per sales and purchase </p>
  
  <pre><code>if let type = type {
              switch type {
              case .purchase:
                  self.title = "Purchase"
                  self.itemList = [
                      PurchaseSubItem(image: UIImage(named: "purchase-orders")!, title: "Purchase Orders", type: .purchaseOrders),
                      PurchaseSubItem(image: UIImage(named: "amended-non")!, title: "Amended/NON-Amended-UNAutho-PO", type: .purchaseOrders),
                      PurchaseSubItem(image: UIImage(named: "purchase-pending")!, title: "Pending GRN PO", type: .purchaseOrders)]
  
              case .sales:
                  self.title = "Sales"
  
                  self.itemList =
                  [
                      SalesSubItem(image: UIImage(named: "sales-order-booking")!, title: "Sales Order Booking", type: .salesOrderBooking),
                      SalesSubItem(image: UIImage(named: "sales-invoice")!, title: "Sales Invoicing", type: .salesInvoicing),
                      SalesSubItem(image: UIImage(named: "sale-gross")!, title: "Sales Gross Contribution", type: .salesGrossContribution)]
  
              default:
                  assertionFailure("Only Purchase and sales are handle here")
              }
          }
  </code></pre>
  
  <p>But I am not able to declare array </p>
  
  <pre><code>var itemList  = [HomeSubItemType]() 
  //ERROR HERE
  </code></pre>
  
  <blockquote>
    <p>Protocol 'HomeSubItemType' can only be used as a generic constraint because it has Self or associated type requirements</p>
  </blockquote>
  
  <p>Please help me to fix this. Thanks in advance </p>