title: Swift protocol property in protocol - Candidate has non-matching type
body: <p>I have a protocol (ProtocolA) containing a single property conforming to a second protocol (ProtocolB).</p>
  <pre><code>public protocol ProtocolA {        
      var prop: ProtocolB? { get }
  }
  
  public protocol ProtocolB {        
  }
  </code></pre>
  <p>I'm trying to declare two classes that will implement those:</p>
  <pre><code>private class ClassA : ProtocolA {    
      var prop: ClassB?
  }
  
  private class ClassB : ProtocolB {
  }
  </code></pre>
  <p>But I get an error:</p>
  <blockquote>
  <p>Type 'ClassA' does not conform to protocol 'ProtocolA'</p>
  <p>Protocol requires property 'prop' with type 'ProtocolB?'</p>
  <p>Candidate has non-matching type 'ClassB?'</p>
  </blockquote>
  <p>Which is annoying as ClassB conforms to ProtocolB.</p>
  <p>in the good-old i'd probably just declare the property as:</p>
  <pre><code>@property (nonatomic) ClassB &lt;ProtocolB&gt; *prop;
  </code></pre>
  <p>but the only way it seems I can get around this in swift is by adding an ivar like:</p>
  <pre><code>private class ClassA : ProtocolA {        
      var _prop: ClassB?
      var prop: ProtocolB? { return _prop }
  }
  </code></pre>
  <p>Is there no way around this?</p>