[swift-corelibs-dev] Fatal error Foundation/NSCalendar.swift, Ubuntu 16.04, Swift 3.0.1

Malcolm Barclay malcolmb at icloud.com
Wed Nov 30 08:22:03 CST 2016


Hi,

Is this a bug in the NSCalendar.swift? On Ubuntu 16.04 with Swift 3.0.1 installed this crashes.

import Foundation
let fromDate = Date()
let toDate = Date(timeIntervalSinceNow: 20)
let components = Calendar.current.dateComponents([.second], from: fromDate, to: toDate)

Result:

fatal error: file Foundation/NSCalendar.swift, line 615
fromDate: Foundation.Date = {
  _time = <extracting data from value failed>

}
toDate: Foundation.Date = {
  _time = <extracting data from value failed>

}
components: Foundation.DateComponents = {
  _handle = <extracting data from value failed>

}
Execution interrupted. Enter code to recover and continue.
Enter LLDB commands to investigate (type :help for assistance.)

Variations of other components also fails, e.g .hour, .minute etc.

Best regards,
Malcolm


More information about the swift-corelibs-dev mailing list