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
Add primary associated types #236
Conversation
Codecov ReportBase: 97.72% // Head: 97.72% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #236 +/- ##
=======================================
Coverage 97.72% 97.72%
=======================================
Files 105 105
Lines 7613 7613
=======================================
Hits 7440 7440
Misses 173 173
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Should we add a Unit Test file for this feature in case somebody accidentally delete it? For example: import XCTest
#if swift(>=5.7)
#if OPENCOMBINE_COMPATIBILITY_TEST
import Combine
@available(macOS 10.15, iOS 13.0, *)
private typealias Published = Combine.Published
@available(macOS 10.15, iOS 13.0, *)
private typealias ObservableObject = Combine.ObservableObject
#else
import OpenCombine
private typealias Published = OpenCombine.Published
private typealias ObservableObject = OpenCombine.ObservableObject
#endif
@available(macOS 10.15, iOS 13.0, *)
final class PrimaryAssociatedTypeTests: XCTestCase {
func testCombinePrimaryAssociatedTypes() {
let p1: some Publisher<Int, Error> = Empty()
...
}
} |
Ok sure. |
Sorry to bother you. Is there any progress on this PR? @broadwaylamb |
I also interested in this PR. But do we really need check for swift version? |
Because swift-tools-version in Package.swift is 5.5, so I think maybe we should also support Swift 5.5 as well. |
Tbh, I would prefer version bump in package. It will really simplify support. Less code is always better |
Support for primary associated types has been merged to master in #239. I've also published a new release. Thank you! |
Apple's official Combine framework also implemented primary associated types feature introduced in swift 5.7.
https://developer.apple.com/documentation/combine/connectablepublisher
https://developer.apple.com/documentation/combine/publisher
https://developer.apple.com/documentation/combine/subscriber
https://developer.apple.com/documentation/combine/subject
https://developer.apple.com/documentation/combine/scheduler
so I changed
ConnectablePublisher
,Publisher
,Subscriber
,Subject
,Scheduler
to support primary associated types as well.