Skip to content

[stdlib] Fix warning on Clock.Duration #58411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2022

Conversation

lorentey
Copy link
Member

@lorentey lorentey commented Apr 26, 2022

#42314 introduced Clock.Duration as an associated type:

@available(SwiftStdlib 5.7, *)
public protocol Clock: Sendable {
  associatedtype Duration: DurationProtocol
  associatedtype Instant: InstantProtocol where Instant.Duration == Duration}

Unfortunately this produces a warning:

…/swift/stdlib/public/Concurrency/Clock.swift:35:28: warning: redundant conformance constraint 'Self.Duration' : 'DurationProtocol'
  associatedtype Duration: DurationProtocol
                           ^

To keep the stdlib build log free of noise, it seems we’ll need to update this declaration to remove the direct requirement.

rdar://92306564

@lorentey
Copy link
Member Author

@swift-ci test

@lorentey
Copy link
Member Author

@swift-ci test

Copy link
Contributor

@phausler phausler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me

@lorentey lorentey merged commit ff387ae into swiftlang:main Apr 27, 2022
@lorentey lorentey deleted the fix-duration-warning branch April 27, 2022 00:13
@benrimmington
Copy link
Contributor

Can this fix be reverted (on main and release/5.7) due to #58780?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants