Skip to content

Commit 4d88f1c

Browse files
committed
Correct the conditional Trait extensions
1 parent 636da1a commit 4d88f1c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Documentation/Proposals/NNNN-custom-test-execution-traits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,9 @@ public protocol Trait: Sendable {
284284
var customTestExecutor: CustomTestExecutor? { get }
285285
}
286286

287-
extension Trait where CustomTestExecutor == Self {
287+
extension Trait where Self: CustomTestExecuting {
288288
// Returns `self`.
289-
public var customTestExecutor: CustomTestExecutor? { get }
289+
public var customTestExecutor: Self? { get }
290290
}
291291

292292
extension Trait where CustomTestExecutor == Never {

Sources/Testing/Traits/Trait.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ public protocol CustomTestExecuting: Sendable {
114114
func execute(_ function: @Sendable () async throws -> Void, for test: Test, testCase: Test.Case?) async throws
115115
}
116116

117-
extension Trait where CustomTestExecutor == Self {
118-
public var customTestExecutor: CustomTestExecutor? {
117+
extension Trait where Self: CustomTestExecuting {
118+
public var customTestExecutor: Self? {
119119
self
120120
}
121121
}

0 commit comments

Comments
 (0)