Skip to content

Commit

Permalink
Merge pull request #8 from to4iki/upcoming_feature
Browse files Browse the repository at this point in the history
Enable upcoming features
  • Loading branch information
to4iki authored Jun 12, 2024
2 parents c52b67b + 21042f1 commit d0dd73e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
xcode: ['14.2']
xcode: ['15.4']
config: ['debug', 'release']
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Xcode Select
run: sudo xcode-select -s /Applications/Xcode_14.2.0.app
run: sudo xcode-select -s /Applications/Xcode_15.4.0.app
- name: Tap
run: brew tap pointfreeco/formulae
- name: Install
Expand Down
18 changes: 17 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
// swift-tools-version:5.0
// swift-tools-version: 5.10

import PackageDescription

let debugSwiftSettings: [PackageDescription.SwiftSetting] = [
.enableUpcomingFeature("ConciseMagicFile", .when(configuration: .debug)), // SE-0274
.enableUpcomingFeature("ForwardTrailingClosures", .when(configuration: .debug)), // SE-0286
.enableUpcomingFeature("ExistentialAny", .when(configuration: .debug)), // SE-0335
.enableUpcomingFeature("BareSlashRegexLiterals", .when(configuration: .debug)), // SE-0354
.enableUpcomingFeature("DeprecateApplicationMain", .when(configuration: .debug)), // SE-0383
.enableUpcomingFeature("ImportObjcForwardDeclarations", .when(configuration: .debug)), // SE-0384
.enableUpcomingFeature("DisableOutwardActorInference", .when(configuration: .debug)), // SE-0401
.enableUpcomingFeature("IsolatedDefaultValues", .when(configuration: .debug)), // SE-0411
.enableUpcomingFeature("GlobalConcurrency", .when(configuration: .debug)), // SE-0412
]

let package = Package(
name: "ForcibleValue",
products: [
Expand All @@ -20,3 +32,7 @@ let package = Package(
],
swiftLanguageVersions: [.v5]
)

for target in package.targets {
target.swiftSettings = debugSwiftSettings
}
2 changes: 1 addition & 1 deletion Sources/ForcibleValue/Default/ForcibleDefault.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extension ForcibleDefault {
self.wrappedValue = wrappedValue
}

public init(from decoder: Decoder) throws {
public init(from decoder: any Decoder) throws {
self.wrappedValue = try T.DefaultValue.init(from: decoder).wrappedValue
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/ForcibleValue/ForcibleBool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public struct ForcibleBool: ForcibleValue {
self.wrappedValue = wrappedValue
}

public init(from decoder: Decoder) throws {
public init(from decoder: any Decoder) throws {
let container = try decoder.singleValueContainer()

if let bool = try? container.decode(Bool.self) {
Expand Down Expand Up @@ -71,7 +71,7 @@ extension ForcibleBool {
self.wrappedValue = wrappedValue
}

public init(from decoder: Decoder) throws {
public init(from decoder: any Decoder) throws {
self.wrappedValue = try ForcibleBool(from: decoder).wrappedValue
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/ForcibleValue/ForcibleNumber.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public struct ForcibleNumber<T: ForcibleNumberSource>: ForcibleValue {
self.wrappedValue = wrappedValue
}

public init(from decoder: Decoder) throws {
public init(from decoder: any Decoder) throws {
let container = try decoder.singleValueContainer()

if let value = try? container.decode(T.self) {
Expand Down Expand Up @@ -60,7 +60,7 @@ extension ForcibleNumber {
self.wrappedValue = wrappedValue
}

public init(from decoder: Decoder) throws {
public init(from decoder: any Decoder) throws {
self.wrappedValue = try ForcibleNumber(from: decoder).wrappedValue
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/ForcibleValue/ForcibleString.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public struct ForcibleString: ForcibleValue {
self.wrappedValue = wrappedValue
}

public init(from decoder: Decoder) throws {
public init(from decoder: any Decoder) throws {
let container = try decoder.singleValueContainer()

if let string = try? container.decode(String.self) {
Expand Down Expand Up @@ -49,7 +49,7 @@ extension ForcibleString {
self.wrappedValue = wrappedValue
}

public init(from decoder: Decoder) throws {
public init(from decoder: any Decoder) throws {
self.wrappedValue = try ForcibleString(from: decoder).wrappedValue
}
}
Expand Down

0 comments on commit d0dd73e

Please sign in to comment.