title: How to write a Realm Results object extension
body: <p>I want write an extension that simplifies a complex filtering on my <code>Results</code> object. I tried this:</p>
  
  <pre><code>extension Results where T:MyProtocol {
      func filterEnabled() -&gt; MyProtocol {
          return self.filter("type == 1").filter { $0.enabled == true }
      }
  }
  </code></pre>
  
  <p>XCode gives me this error: <code>Ambiguous reference to member 'filter'</code>. I think <code>T:MyProtocol</code> constraint is not enough.</p>
  
  <p>How can I accomplish what I'm trying to do?</p>