mirror of
https://github.com/ReactiveX/RxSwift.git
synced 2024-10-04 22:17:41 +03:00
Fix Swift 5 compiler #ifdefs
This commit is contained in:
parent
6f918cd22b
commit
bd084821c3
@ -171,14 +171,14 @@ extension Bag {
|
||||
}
|
||||
|
||||
extension BagKey: Hashable {
|
||||
#if !swift(>=4.2.2)
|
||||
var hashValue: Int {
|
||||
return rawValue.hashValue
|
||||
}
|
||||
#else
|
||||
#if swift(>=4.2)
|
||||
func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(rawValue)
|
||||
}
|
||||
#else
|
||||
var hashValue: Int {
|
||||
return rawValue.hashValue
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -71,9 +71,13 @@ final class ZipSink2_<E1, E2, O: ObserverType> : ZipSink<O> {
|
||||
rxFatalError("Unhandled case (Function)")
|
||||
}
|
||||
|
||||
#if !swift(>=4.2.2)
|
||||
#if swift(>=4.2)
|
||||
#if !compiler(>=5.0)
|
||||
return false
|
||||
#endif
|
||||
#else
|
||||
return false
|
||||
#endif
|
||||
}
|
||||
|
||||
func run() -> Disposable {
|
||||
@ -185,9 +189,13 @@ final class ZipSink3_<E1, E2, E3, O: ObserverType> : ZipSink<O> {
|
||||
rxFatalError("Unhandled case (Function)")
|
||||
}
|
||||
|
||||
#if !swift(>=4.2.2)
|
||||
#if swift(>=4.2)
|
||||
#if !compiler(>=5.0)
|
||||
return false
|
||||
#endif
|
||||
#else
|
||||
return false
|
||||
#endif
|
||||
}
|
||||
|
||||
func run() -> Disposable {
|
||||
@ -307,9 +315,13 @@ final class ZipSink4_<E1, E2, E3, E4, O: ObserverType> : ZipSink<O> {
|
||||
rxFatalError("Unhandled case (Function)")
|
||||
}
|
||||
|
||||
#if !swift(>=4.2.2)
|
||||
#if swift(>=4.2)
|
||||
#if !compiler(>=5.0)
|
||||
return false
|
||||
#endif
|
||||
#else
|
||||
return false
|
||||
#endif
|
||||
}
|
||||
|
||||
func run() -> Disposable {
|
||||
@ -437,9 +449,13 @@ final class ZipSink5_<E1, E2, E3, E4, E5, O: ObserverType> : ZipSink<O> {
|
||||
rxFatalError("Unhandled case (Function)")
|
||||
}
|
||||
|
||||
#if !swift(>=4.2.2)
|
||||
#if swift(>=4.2)
|
||||
#if !compiler(>=5.0)
|
||||
return false
|
||||
#endif
|
||||
#else
|
||||
return false
|
||||
#endif
|
||||
}
|
||||
|
||||
func run() -> Disposable {
|
||||
@ -575,9 +591,13 @@ final class ZipSink6_<E1, E2, E3, E4, E5, E6, O: ObserverType> : ZipSink<O> {
|
||||
rxFatalError("Unhandled case (Function)")
|
||||
}
|
||||
|
||||
#if !swift(>=4.2.2)
|
||||
#if swift(>=4.2)
|
||||
#if !compiler(>=5.0)
|
||||
return false
|
||||
#endif
|
||||
#else
|
||||
return false
|
||||
#endif
|
||||
}
|
||||
|
||||
func run() -> Disposable {
|
||||
@ -721,9 +741,13 @@ final class ZipSink7_<E1, E2, E3, E4, E5, E6, E7, O: ObserverType> : ZipSink<O>
|
||||
rxFatalError("Unhandled case (Function)")
|
||||
}
|
||||
|
||||
#if !swift(>=4.2.2)
|
||||
#if swift(>=4.2)
|
||||
#if !compiler(>=5.0)
|
||||
return false
|
||||
#endif
|
||||
#else
|
||||
return false
|
||||
#endif
|
||||
}
|
||||
|
||||
func run() -> Disposable {
|
||||
@ -875,9 +899,13 @@ final class ZipSink8_<E1, E2, E3, E4, E5, E6, E7, E8, O: ObserverType> : ZipSink
|
||||
rxFatalError("Unhandled case (Function)")
|
||||
}
|
||||
|
||||
#if !swift(>=4.2.2)
|
||||
#if swift(>=4.2)
|
||||
#if !compiler(>=5.0)
|
||||
return false
|
||||
#endif
|
||||
#else
|
||||
return false
|
||||
#endif
|
||||
}
|
||||
|
||||
func run() -> Disposable {
|
||||
|
@ -71,9 +71,13 @@ final class ZipSink<%= i %>_<<%= (Array(1...i).map { "E\($0)" }).joined(separato
|
||||
rxFatalError("Unhandled case \(index)")
|
||||
}
|
||||
|
||||
#if !swift(>=4.2.2)
|
||||
#if swift(>=4.2)
|
||||
#if !compiler(>=5.0)
|
||||
return false
|
||||
#endif
|
||||
#else
|
||||
return false
|
||||
#endif
|
||||
}
|
||||
|
||||
func run() -> Disposable {
|
||||
|
@ -38,15 +38,15 @@ extension Subscription
|
||||
: Hashable
|
||||
, Equatable {
|
||||
/// The hash value.
|
||||
#if !swift(>=4.2.2)
|
||||
public var hashValue: Int {
|
||||
return self.subscribe.hashValue ^ self.unsubscribe.hashValue
|
||||
}
|
||||
#else
|
||||
#if swift(>=4.2)
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(self.subscribe)
|
||||
hasher.combine(self.unsubscribe)
|
||||
}
|
||||
#else
|
||||
public var hashValue: Int {
|
||||
return self.subscribe.hashValue ^ self.unsubscribe.hashValue
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -558,7 +558,13 @@ extension CompletableTest {
|
||||
}
|
||||
}
|
||||
|
||||
#if !swift(>=4.2.2)
|
||||
#if swift(>=4.2)
|
||||
#if !compiler(>=5.0)
|
||||
extension Never: Equatable {
|
||||
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
extension Never: Equatable {
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user