Skip to content
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

[SR-13616] Swift/Foundation/Linux: Date does not implement Strideable #3969

Closed
swift-ci opened this issue Sep 26, 2020 · 2 comments
Closed

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-13616
Radar rdar://problem/69701610
Original Reporter gkaindl (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

macOS:

xxx@yyyyyy$ swift --version
Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)
Target: x86_64-apple-darwin19.6.0

Linux:

root@377b4eb21ba1:/tmp# swift --version
Swift version 5.3 (swift-5.3-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional Detail from JIRA
Votes 2
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: c3b6f4573b92d32f4ad3004b160fcd38

Issue Description:

On macOS, Date correctly implements Strideable, but it doesn't on Linux (swift-5.3-RELEASE).

Try running the attached test.swift file on macOS, yielding the expected output:

xxx@yyyyyyy$ swift test.swift
1.0

Trying to run the same on Linux (using the official swift:latest docker image) yields:

root@377b4eb21ba1:/tmp# swift test.swift
test.swift:5:12: error: value of type 'Date' has no member 'distance'
print(date.distance(to: date.advanced(by: 1.0)))
      ~~~~ ^~~~~~~~
test.swift:5:30: error: value of type 'Date' has no member 'advanced'
print(date.distance(to: date.advanced(by: 1.0)))
                        ~~~~ ^~~~~~~~

Test program (also attached):

import Foundation
  
let date = Date()

print(date.distance(to: date.advanced(by: 1.0)))
@typesanitizer
Copy link

@swift-ci create

@spevans
Copy link
Collaborator

spevans commented Oct 5, 2020

This is fixed in the main branch, a backport to 5.3 is @ #2890

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants