Skip to content

Conversation

@compnerd
Copy link
Member

There is no implicit conversion from Int to Date. The implicit cast
fails, resulting in nil being returned for the creationDate
property. Explicitly unwrap the result of the .creationDate attribute
and use that to construct the Date to return.

Partially addresses: SR-13617

There is no implicit conversion from `Int` to `Date`.  The implicit cast
fails, resulting in `nil` being returned for the `creationDate`
property.  Explicitly unwrap the result of the `.creationDate` attribute
and use that to construct the `Date` to return.

Partially addresses: SR-13617
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

CC: @spevans @millenomi

get {
guard let timestamp: Int = _get(.creationDateKey) else { return nil }
return Date(timeIntervalSince1970: TimeInterval(timestamp))
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, set doesn't have the corresponding issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats actually why Im not 100% certain why this is needed. There are other Date accessors which should also see similar things? The test suite seems to be passing though, so Im not sure what is special here.

@compnerd
Copy link
Member Author

compnerd commented Sep 28, 2020

Okay, with the help from @millenomi this is no longer necessary (#2884 is the complete fix)

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