Repository navigation
Conversation
1.2.1 shipped Duration.minutes(_:), .hours(_:) and .timeInterval as public API, and the README's log examples use .minutes(30). They were removed on main because HandySwift defines the same three helpers, which made '.minutes(30)' ambiguous in any file importing both modules. Removing them would break every ErrorKit-only user in the next release. Marking them @_disfavoredOverload keeps both cases compiling: alone, ErrorKit's helpers resolve; next to HandySwift, the compiler prefers HandySwift's without an ambiguity error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keeps the next ErrorKit release source-compatible with 1.2.1.
1.2.1 ships
Duration.minutes(_:),Duration.hours(_:)andDuration.timeIntervalas public API, and the README and DocC examples call the log APIs with them (ErrorKit.logAttachment(ofLast: .minutes(30))). Onmain, c9c2fe8 madetimeIntervalinternal and removed the other two, because HandySwift defines the same three helpers: in a file that imports both modules – as everything built on FlineDevKit does –.minutes(30)was ambiguous. Releasingmainas it is would turn that fix into a compile error for every app that uses ErrorKit without HandySwift, including the README's own sample.This branch brings the three helpers back as
public, marked@_disfavoredOverload. The attribute only lowers their rank when another candidate exists, so:.minutes(30)resolves toAlternatives considered: shipping the removal as 2.0.0 (a major release for three convenience helpers, while the docs keep needing a replacement for
.minutes(30)), or removing the helpers from HandySwift instead (moves the break to HandySwift's users).How this was verified
DurationHelperTestschecks the three helpers from a plainimport ErrorKit. Against the sources onmainit fails to compile; on this branch the full suite passes:The two-module case was checked with a throwaway package that has one executable importing ErrorKit and HandySwift (local checkouts) and one importing only ErrorKit, both calling
.minutes(30),.hours(1).timeIntervalandErrorKit.loggedData(ofLast: .minutes(5)). Both built and ran. Without@_disfavoredOverload, the two-module target failed again: