title: Passing Data into function that accepts generic collection
body: <p>I have a function that accepts generic collections.</p>
  
  <pre><code>func foo&lt;T: BidirectionalCollection&gt;(_ bar: T)
      where T.Iterator.Element == UInt8,
            T.SubSequence: BidirectionalCollection &amp; RangeReplaceableCollection,
            T.SubSequence.Iterator.Element == UInt8,
            T.SubSequence.Index == T.Index,
            T.SubSequence.SubSequence == T.SubSequence
  {
      //
  }
  </code></pre>
  
  <p>I want to call this function with <code>Data</code> as T:</p>
  
  <pre><code>foo(Data())
  </code></pre>
  
  <p>However, this gives the error:</p>
  
  <blockquote>
    <p>error: generic parameter 'T' could not be inferred</p>
  </blockquote>
  
  <p>What's going on here? How to properly call the function with a <code>Data</code> instance?</p>