Skip to content

Approachable Concurrency Setting breaks ClientMiddleware conformance #814

Closed as duplicate

Description

@aaron-foreflight

Description

With the Approachable Concurrency setting enabled (set to Yes) in Xcode 26 beta 5+ you cannot create a conformance to ClientMiddleware. When you disable Approachable Concurrency in the Swift Compiler - Concurrency settings the conformance works. Approachable Concurrency is enabled by default in new Xcode projects with Xcode 26.

This issue is similar to #796

Image

Reproduction

import Foundation
import OpenAPIRuntime
import HTTPTypes

class AuthenticationMiddleware {
    
    private let bearerToken: String
    
    init(bearerToken: String) {
        self.bearerToken = bearerToken
    }
}

extension AuthenticationMiddleware: ClientMiddleware {
    func intercept(
        _ request: HTTPRequest,
        body: HTTPBody?,
        baseURL: URL,
        operationID: String,
        next: (HTTPRequest, HTTPBody?, URL) async throws -> (HTTPResponse, HTTPBody?)
    ) async throws -> (HTTPResponse, HTTPBody?) {
        var request = request
        request.headerFields[.authorization] = "Bearer \(bearerToken)"
        return try await next(request, body, baseURL)
    }
}

Package version(s)

Image

Expected behavior

I would expect my conformance to compile, as it did with older Xcodes.

Environment

Xcode 26 beta 5, macOS 15.6

Additional information

No response

Activity

  1. added
    kind/bugFeature doesn't work as expected.
    status/triageCollecting information required to triage the issue.
    on Aug 19, 2025
  2. aaron-foreflight commented on Aug 19, 2025

    @aaron-foreflight
    Author

    Oops, my issue appears to be a duplicate of #804

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugFeature doesn't work as expected.status/triageCollecting information required to triage the issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions