Skip to content

Adopt explicit existential any #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 17, 2023
Merged

Conversation

czechboy0
Copy link
Contributor

@czechboy0 czechboy0 commented Jul 14, 2023

Motivation

As a follow-on to apple/swift-openapi-generator#99, let's also enable explicit existential any in the runtime library.

Modifications

Enabled the flag in Package.swift (for Swift 5.9 and newer) and updated all the usage sites.

Result

The codebase is closer to being ready for Swift 6.

Test Plan

Updated unit tests as well, all is passing locally.

@czechboy0 czechboy0 requested a review from simonjbeaumont July 14, 2023 13:26
@czechboy0
Copy link
Contributor Author

Please ignore API breakage, known to fail when making changes like this, but safe to land:

10 breaking changes detected in OpenAPIRuntime:
  💔 API breakage: var OpenAPIValueContainer.value has declared type change from Swift.Sendable? to (Swift.Sendable)?
  💔 API breakage: accessor OpenAPIValueContainer.value.Get() has return type change from Swift.Sendable? to (Swift.Sendable)?
  💔 API breakage: accessor OpenAPIValueContainer.value.Set() has parameter 0 type change from Swift.Sendable? to (Swift.Sendable)?
  💔 API breakage: var OpenAPIObjectContainer.value has declared type change from [Swift.String : Swift.Sendable?] to [Swift.String : (Swift.Sendable)?]
  💔 API breakage: accessor OpenAPIObjectContainer.value.Get() has return type change from [Swift.String : Swift.Sendable?] to [Swift.String : (Swift.Sendable)?]
  💔 API breakage: accessor OpenAPIObjectContainer.value.Set() has parameter 0 type change from [Swift.String : Swift.Sendable?] to [Swift.String : (Swift.Sendable)?]
  💔 API breakage: var OpenAPIArrayContainer.value has declared type change from [Swift.Sendable?] to [(Swift.Sendable)?]
  💔 API breakage: accessor OpenAPIArrayContainer.value.Get() has return type change from [Swift.Sendable?] to [(Swift.Sendable)?]
  💔 API breakage: accessor OpenAPIArrayContainer.value.Set() has parameter 0 type change from [Swift.Sendable?] to [(Swift.Sendable)?]
  💔 API breakage: constructor ServerError.init(operationID:request:requestMetadata:operationInput:operationOutput:underlyingError:) has parameter 5 type change from Swift.Error to (Swift.Error)

Copy link
Collaborator

@simonjbeaumont simonjbeaumont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@czechboy0
Copy link
Contributor Author

@swift-server-bot test this please

@czechboy0
Copy link
Contributor Author

The changes to the code are good, but not adding the enforcement yet until apple/swift-openapi-generator#119

@czechboy0
Copy link
Contributor Author

Ok Integration Test passes again.

@simonjbeaumont
Copy link
Collaborator

Rather than just disable it everywhere, let's enable it in just the Swift 5.9+ builds, by adding -Xswiftc -enable-upcoming-feature -Xswiftc ExistentialAny to the 5.9 and nightly docker-compose files.

This way we won't regress.

@czechboy0 czechboy0 merged commit 2080076 into apple:main Jul 17, 2023
@czechboy0 czechboy0 deleted the hd-existential-any branch July 17, 2023 09:22
@czechboy0 czechboy0 added the semver/none No version bump required. label Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants