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

[Tests] NFC: Remove overload of GeneralizedTime.init(_:) #7986

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Sep 19, 2024

Motivation:

swift-certificates now implements initializer that accepts Date and doesn't throw which means this method is redundant but also incorrect because overloading only on throws is ambiguous in most cases due to throws checking not being part of the expression checking.

Uses of this overload type-checked only because it was always preferred before due to old type-checker hacks that we are trying to remove.

Modifications:

  • Removes GeneralizedTime.init(_:) throws that was added before swift-certificates introduced their own non-throwing version.

Result:

No more duplicate code that is less safe than what swift-certificates vends.

`swift-certificates` now implements initializer that accepts
`Date` and doesn't throw which means this method is redundant
but also incorrect because overloading only on `throws` is
ambiguous in most cases due to throws checking not being part
of the expression checking.

Uses of this overload type-checked only because it was always
preferred before due to old type-checker hacks that we are
trying to remove.
@xedin
Copy link
Contributor Author

xedin commented Sep 19, 2024

@swift-ci please test

@xedin xedin merged commit ca3076a into swiftlang:main Sep 20, 2024
5 checks passed
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