Associatedtype Swift 3
<p>I'm trying understand generics culture in <strong>Swift</strong> so I've written a small example. But it does not compile. </p>

<p>Error: <strong>Generic parameter 'P' could not be inferred</strong>
I can't understand for I'm doing wrong.</p>

<pre><code>protocol Protocol_1 {
    associatedtype T
}

protocol Protocol_A {}
struct SomeStruct_2: Protocol_A {}

struct SomeStruct_1: Protocol_1 {
    typealias T = Protocol_A
}


let struct1 = SomeStruct_1()
testFunction(t: struct1) // *Generic parameter 'P' could not be inferred*

func testFunction&lt;P: Protocol_1&gt;(t: P) where P.T : Protocol_A {

}
</code></pre>