Skip to content

Whole differences should return integers #81

Description

@davedelong

The differenceInWhole... functions should just return Int values. The underlying TimeDifference, because of the nature of the computation, will only have a single represented value, so the extra indirection is unnecessary.

This could be implemented by adding the new Int-returning methods but marking them as @_disfavoredOverload; that would mean existing code would continue to compile without issues and would not require modifications.

Eventually when Time reaches 2.0 status, the @_disfavoredOverload attribute could swap from the Int-returning method to the TimeDifference-returning method, because that's a source/API-breaking change, which is appropriate for a major version update.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions