title: Can I use case enum comparison as a boolean expression?
body: <p>I have an enum with associated values:</p>
  
  <pre><code>enum SessionState {
      ...
      case active(authToken: String)
      ...
  }
  </code></pre>
  
  <p>I can use <code>case let</code> to compare enum cases with associated values:</p>
  
  <pre><code>if case .active = session.state {
      return true
  } else {
      return false
  }
  </code></pre>
  
  <p>But can I directly return the <code>case</code> as a bool expression? Something like:</p>
  
  <pre><code>// Error: Enum 'case' is not allowed outside of an enum
  return (case .active = session.state)
  </code></pre>
  
  <p>A simple comparison doesn’t work either:</p>
  
  <pre><code>// Binary operator '==' cannot be applied to operands of type 'SessionState' and '_'
  return (session.state == .active)
  </code></pre>