title: Swift "Ambiguous use of operator '=='"
body: <p>I'm trying to compare an instance of <code>UIUserNotificationType</code>, which is a <code>RawOptionSet</code>, to some value:</p>
  
  <pre><code>var types: UIUserNotificationType = ...
  if types == UIUserNotificationType.None { // &lt;-- Error here
       ...
  }
  </code></pre>
  
  <p>But am getting an error on the second line:</p>
  
  <blockquote>
    <p>Ambiguous use of operator '=='</p>
  </blockquote>
  
  <p>Any ideas about where this might come from?</p>
  
  <p>(I could do <code>types.toRaw() == 0</code>, but I think it'is quite ugly...)</p>
  
  <hr>
  
  <p><code>UIUserNotificationType</code> declaration for reference:</p>
  
  <pre><code>struct UIUserNotificationType : RawOptionSet {
      init(_ value: UInt)
      var value: UInt
      static var None: UIUserNotificationType { get }
      static var Badge: UIUserNotificationType { get }
      static var Sound: UIUserNotificationType { get }
      static var Alert: UIUserNotificationType { get }
  }
  </code></pre>