Cannot convert return expression of generic protocol's function type implementation
<p>I'd like to use swift generics in a way described below:</p>

<pre><code>class ResponseContainer {

}

protocol DisplayManageable {

    func getModel&lt;ModelType: ResponseContainer&gt;() -&gt; ModelType?
}

class DisplayBaseManager&lt;ObtainedModelType: ResponseContainer&gt;: NSObject, DisplayManageable {

    var modelObtained: ObtainedModelType? = nil

    func getModel&lt;ObtainedModelType&gt;() -&gt; ObtainedModelType? {

        return modelObtained
    }
}
</code></pre>

<p>But I have a problem with this code, more precisely there is a problem in this line:</p>

<pre><code>return modelObtained
</code></pre>

<p>And I'm getting the error:</p>

<blockquote>
  <p>Cannot convert return expression of type 'ObtainedModelType?' to
  return type 'ObtainedModelType?'</p>
</blockquote>

<p>And now my simple question, why can't I do that? What's wrong with that?</p>

<p>Generics in protocol's function and in class definitions are the same. Everything looks fine in my opinion and logically is ok, so why cannot I do so?</p>