Skip to content

[6.2] Add static .nanoseconds(_: Double) to Duration (#81210) #81236

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
May 2, 2025

Conversation

stephentyrone
Copy link
Contributor

SE-0329 defines the following static factory methods:

public static func seconds<T: BinaryInteger>(_ seconds: T) -> Duration
public static func seconds(_ seconds: Double) -> Duration
public static func milliseconds<T: BinaryInteger>(_ milliseconds: T) -> Duration
public static func milliseconds(_ milliseconds: Double) -> Duration
public static func microseconds<T: BinaryInteger>(_ microseconds: T) -> Duration
public static func microseconds(_ microseconds: Double) -> Duration
public static func nanoseconds<T: BinaryInteger>(_ value: T) -> Duration

For no good reason, the obvious additional method:

public static func nanoseconds(_ nanoseconds: Double) -> Duration

was omitted. After talking this through with the LSG, we have decided that this is simply a bug, and we will add this method without formal evolution review.

SE-0329 defines the following static factory methods:
```
public static func seconds<T: BinaryInteger>(_ seconds: T) -> Duration
public static func seconds(_ seconds: Double) -> Duration
public static func milliseconds<T: BinaryInteger>(_ milliseconds: T) -> Duration
public static func milliseconds(_ milliseconds: Double) -> Duration
public static func microseconds<T: BinaryInteger>(_ microseconds: T) -> Duration
public static func microseconds(_ microseconds: Double) -> Duration
public static func nanoseconds<T: BinaryInteger>(_ value: T) -> Duration
```
For no good reason, the obvious additional method:
```
public static func nanoseconds(_ nanoseconds: Double) -> Duration
```
was omitted. After talking this through with the LSG, we have decided
that this is simply a bug, and we will add this method without formal
evolution review.
@stephentyrone stephentyrone requested a review from a team as a code owner May 1, 2025 19:52
@stephentyrone
Copy link
Contributor Author

@swift-ci test

@stephentyrone stephentyrone changed the title Add static .nanoseconds(_: Double) to Duration (#81210) [6.2] Add static .nanoseconds(_: Double) to Duration (#81210) May 2, 2025
@stephentyrone
Copy link
Contributor Author

@swift-ci test

@stephentyrone stephentyrone enabled auto-merge (squash) May 2, 2025 18:51
@stephentyrone
Copy link
Contributor Author

@swift-ci test Linux

@stephentyrone stephentyrone merged commit 88e29fa into swiftlang:release/6.2 May 2, 2025
5 checks passed
@stephentyrone stephentyrone deleted the nanoseconds-6.2 branch May 4, 2025 23:23
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.

2 participants