title: Multiple Type Constraints in Swift
body: <p>Let's say I have these protocols:</p>
  
  <pre><code>protocol SomeProtocol {
  
  }
  
  protocol SomeOtherProtocol {
  
  }
  </code></pre>
  
  <p>Now, if I want a function that takes a generic type, but that type must conform to <code>SomeProtocol</code> I could do:</p>
  
  <pre><code>func someFunc&lt;T: SomeProtocol&gt;(arg: T) {
      // do stuff
  }
  </code></pre>
  
  <p>But is there a way to add a type constraint for multiple protocols?</p>
  
  <pre><code>func bothFunc&lt;T: SomeProtocol | SomeOtherProtocol&gt;(arg: T) {
  
  }
  </code></pre>
  
  <p>Similar things use commas, but in this case, it would start the declaration of a different type.  Here's what I've tried.</p>
  
  <pre><code>&lt;T: SomeProtocol | SomeOtherProtocol&gt;
  &lt;T: SomeProtocol , SomeOtherProtocol&gt;
  &lt;T: SomeProtocol : SomeOtherProtocol&gt;
  </code></pre>