Skip to content

Commit 59e61d8

Browse files
authored
Merge pull request #42316 from lorentey/clock-duration-5.7
[5.7][stdlib] Add `Clock.Duration` as an associated type requirement
2 parents 41d720e + 5476123 commit 59e61d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/public/Concurrency/Clock.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ import Swift
3232
/// `SuspendingClock`.
3333
@available(SwiftStdlib 5.7, *)
3434
public protocol Clock: Sendable {
35-
associatedtype Instant: InstantProtocol
35+
associatedtype Duration: DurationProtocol
36+
associatedtype Instant: InstantProtocol where Instant.Duration == Duration
3637

3738
var now: Instant { get }
3839
var minimumResolution: Instant.Duration { get }

0 commit comments

Comments
 (0)