From 2beb72d60b01ea669b400ad87a8f7a788c800e37 Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Mon, 17 Jul 2023 09:40:53 +0200 Subject: [PATCH 1/2] Disable ExistentialAny temporarily --- Package.swift | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Package.swift b/Package.swift index 00c3218..ef018de 100644 --- a/Package.swift +++ b/Package.swift @@ -15,13 +15,6 @@ import Foundation import PackageDescription -// General Swift-settings for all targets. -let swiftSettings: [SwiftSetting] = [ - // https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md - // Require `any` for existential types. - .enableUpcomingFeature("ExistentialAny") -] - let package = Package( name: "swift-openapi-urlsession", platforms: [ @@ -42,13 +35,11 @@ let package = Package( name: "OpenAPIURLSession", dependencies: [ .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), - ], - swiftSettings: swiftSettings + ] ), .testTarget( name: "OpenAPIURLSessionTests", - dependencies: ["OpenAPIURLSession"], - swiftSettings: swiftSettings + dependencies: ["OpenAPIURLSession"] ), ] ) From ce0f944cbc11f196c0a6008065933bf671d7f0c5 Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Mon, 17 Jul 2023 11:14:38 +0200 Subject: [PATCH 2/2] PR feedback --- Package.swift | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index ef018de..1e9579e 100644 --- a/Package.swift +++ b/Package.swift @@ -15,6 +15,17 @@ import Foundation import PackageDescription +// General Swift-settings for all targets. +var swiftSettings: [SwiftSetting] = [] + +#if swift(>=5.9) +swiftSettings.append( + // https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md + // Require `any` for existential types. + .enableUpcomingFeature("ExistentialAny") +) +#endif + let package = Package( name: "swift-openapi-urlsession", platforms: [ @@ -35,11 +46,13 @@ let package = Package( name: "OpenAPIURLSession", dependencies: [ .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), - ] + ], + swiftSettings: swiftSettings ), .testTarget( name: "OpenAPIURLSessionTests", - dependencies: ["OpenAPIURLSession"] + dependencies: ["OpenAPIURLSession"], + swiftSettings: swiftSettings ), ] )