title: How to use generic protocol in the method signature?
body: <p>The context is I have a class <code>A</code> that has many property but I only want to expose few of them and one of them is a generic type. </p>
  
  <p>I then try to have a generic protocol (maybe that's an wrong name?) for the A.</p>
  
  <p>It seems fine but when I try to use the protocol instead of the struct in the method, it won't compile. </p>
  
  <p>Any suggestions?</p>
  
  <pre><code>protocol AProtocol {
      associatedtype T
  
      var t: T? { get }
  }
  
  struct A&lt;Type&gt;: AProtocol {
      typealias T = Type
      var t: Type?
  
      var a: Int
      var b: Int
      var c: Int
      var d: Int
      var e: Int
  }
  
  struct Main {
      func show&lt;T: Decodable&gt;(a: AProtocol&lt;T&gt;) { // error: Cannot specialize non-generic type 'AProtocol'
  
      }
  }
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The snippet below is after I updated from @Sweeper's answer, there's a slight tweak for the implementation because originally in my project it is a closure.</p>
  
  <pre><code>protocol AProtocol {
      associatedtype T
  
      var t: T? { get }
  }
  
  struct A&lt;Type&gt;: AProtocol {
      typealias T = Type
      var t: Type?
  
      var a: Int?
      var b: Int?
      var c: Int?
      var d: Int?
      var e: Int?
  }
  
  struct Main {
      func show&lt;T, U&gt;(completion: (U) -&gt; Void) where T: Decodable, U: AProtocol, U.T == T {
          let a = A&lt;Int&gt;()
          completion(a) //error: '(A&lt;Int&gt;) -&gt; Void' is not convertible to '(U) -&gt; Void'
      }
  }
  </code></pre>
  
  <p>Could you explain why this wouldn't work?</p>