

@frozen
public enum Optional<Wrapped: ~Copyable & ~Escapable>: ~Copyable, ~Escapable {


  case none


  case some(Wrapped)
}

extension Optional: Copyable where Wrapped: Copyable & ~Escapable {}

extension Optional: Escapable where Wrapped: Escapable & ~Copyable {}

extension Optional: BitwiseCopyable
where Wrapped: BitwiseCopyable & ~Escapable {}

extension Optional: Sendable where Wrapped: ~Copyable & ~Escapable & Sendable {}


@_preInverseGenerics
extension Optional: ExpressibleByNilLiteral
where Wrapped: ~Copyable & ~Escapable {


  @_transparent
  @_preInverseGenerics
  @_lifetime(immortal)
  public init(nilLiteral: ()) {
    self = .none
  }
}

extension Optional where Wrapped: ~Copyable & ~Escapable {

  @_transparent
  @_preInverseGenerics
  @_lifetime(copy value)
  public init(_ value: consuming Wrapped) {
    self = .some(value)
  }
}

extension Optional {


  @_alwaysEmitIntoClient
  public func map<E: Error, U: ~Copyable>(
    _ transform: (Wrapped) throws(E) -> U
  ) throws(E) -> U? {
    switch self {
    case .some(let y):
      return .some(try transform(y))
    case .none:
      return .none
    }
  }

  @_spi(SwiftStdlibLegacyABI) @available(swift, obsoleted: 1)
  @usableFromInline


... [truncated 9883 chars] ...

esult = .some(.none)
      return true
    }

    if let unwrappedResult = source as? Wrapped {
      result = .some(.some(unwrappedResult))
      return true
    } else {
      result = .none
      return false
    }
  }

  @_effects(readonly)
  public static func _unconditionallyBridgeFromObjectiveC(_ source: AnyObject?)
      -> Optional<Wrapped> {
    if let nonnullSource = source {

      if nonnullSource === _nilSentinel {
        return .none
      } else {
        return .some(nonnullSource as! Wrapped)
      }
    } else {

      return .none
    }
  }
}
#endif