Skip to content

Commit d366fe5

Browse files
authored
Merge pull request #42314 from lorentey/clock-duration
[stdlib] Add `Clock.Duration` as an associated type requirement
2 parents 1d8f464 + 0aadfb0 commit d366fe5

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)