Skip to content

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