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

Fix compile errors with latest ReactiveSwift #29

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "ReactiveCocoa/ReactiveObjC" ~> 3.0.0
github "ReactiveCocoa/ReactiveSwift" ~> 1.1
github "ReactiveCocoa/ReactiveSwift" "2.0.0-rc.3"
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "jspahrsummers/xcconfigs" "3d9d996"
github "Quick/Quick" ~> 1.1
github "Quick/Nimble" "8116a83864ee78339798c3ef425c42f6ca6bf034"
github "Quick/Nimble" ~> 6.1
Copy link
Member

Choose a reason for hiding this comment

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

Let's use ~> 7.0.1

6 changes: 3 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github "Quick/Nimble" "8116a83864ee78339798c3ef425c42f6ca6bf034"
github "Quick/Nimble" "v6.1.0"
github "Quick/Quick" "v1.1.0"
github "ReactiveCocoa/ReactiveObjC" "3.0.0"
github "antitypical/Result" "3.2.1"
github "ReactiveCocoa/ReactiveSwift" "2.0.0-rc.3"
github "antitypical/Result" "3.2.3"
github "jspahrsummers/xcconfigs" "3d9d99634cae6d586e272543d527681283b33eb0"
github "ReactiveCocoa/ReactiveSwift" "1.1.2"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Nimble
Submodule Nimble updated 31 files
+3 −0 .swiftlint.yml
+3 −0 Dockerfile.test
+7 −5 Nimble.podspec
+188 −104 Nimble.xcodeproj/project.pbxproj
+1 −1 Nimble.xcodeproj/xcshareddata/xcschemes/Nimble-iOS.xcscheme
+1 −1 Nimble.xcodeproj/xcshareddata/xcschemes/Nimble-macOS.xcscheme
+1 −1 Nimble.xcodeproj/xcshareddata/xcschemes/Nimble-tvOS.xcscheme
+0 −3 Sources/Lib/CwlPreconditionTesting/CwlCatchException/.gitignore
+0 −0 Sources/Lib/CwlPreconditionTesting/CwlCatchException/CwlCatchException.swift
+0 −28 Sources/Lib/CwlPreconditionTesting/CwlCatchException/CwlCatchException/Info.plist
+0 −0 Sources/Lib/CwlPreconditionTesting/CwlCatchExceptionSupport/CwlCatchException.m
+0 −0 Sources/Lib/CwlPreconditionTesting/CwlCatchExceptionSupport/include/CwlCatchException.h
+2 −1 Sources/Lib/CwlPreconditionTesting/CwlMachBadInstructionHandler/CwlMachBadInstructionHandler.m
+0 −5 Sources/Lib/CwlPreconditionTesting/CwlMachBadInstructionHandler/include/CwlMachBadInstructionHandler.h
+2 −2 Sources/Lib/CwlPreconditionTesting/CwlMachBadInstructionHandler/mach_excServer.c
+0 −0 Sources/Lib/CwlPreconditionTesting/CwlMachBadInstructionHandler/mach_excServer.h
+11 −11 Sources/Lib/CwlPreconditionTesting/CwlPreconditionTesting/CwlBadInstructionException.swift
+23 −22 Sources/Lib/CwlPreconditionTesting/CwlPreconditionTesting/CwlCatchBadInstruction.swift
+14 −17 Sources/Lib/CwlPreconditionTesting/CwlPreconditionTesting/CwlCatchBadInstructionPOSIX.swift
+5 −5 Sources/Lib/CwlPreconditionTesting/CwlPreconditionTesting/CwlDarwinDefinitions.swift
+0 −25 Sources/Lib/CwlPreconditionTesting/CwlPreconditionTesting/Info.plist
+30 −0 Sources/Lib/CwlPreconditionTesting/CwlPreconditionTesting/Mach/CwlPreconditionTesting.h
+27 −0 Sources/Lib/CwlPreconditionTesting/CwlPreconditionTesting/Posix/CwlPreconditionTesting.h
+1 −6 Sources/Nimble/Nimble.h
+1 −5 Sources/Nimble/Utils/Errors.swift
+2 −0 Sources/NimbleObjectiveC/DSL.h
+4 −0 Tests/NimbleTests/Matchers/BeGreaterThanOrEqualToTest.swift
+3 −0 Tests/NimbleTests/Matchers/BeGreaterThanTest.swift
+2 −0 Tests/NimbleTests/objc/ObjCBeGreaterThanOrEqualToTest.m
+1 −0 Tests/NimbleTests/objc/ObjCBeGreaterThanTest.m
+21 −8 test
2 changes: 1 addition & 1 deletion Carthage/Checkouts/ReactiveSwift
Submodule ReactiveSwift updated 69 files
+0 −10 .Package.test.swift
+3 −0 .github/PULL_REQUEST_TEMPLATE.md
+4 −0 .gitignore
+9 −14 .jazzy.yaml
+69 −27 .travis.yml
+242 −0 CHANGELOG.md
+1 −1 Cartfile.private
+1 −1 Cartfile.resolved
+1 −1 Carthage/Checkouts/Nimble
+13 −13 Documentation/APIContracts.md
+6 −6 Documentation/BasicOperators.md
+173 −0 Documentation/Example.OnlineSearch.md
+1 −1 Documentation/FrameworkOverview.md
+115 −0 Documentation/ReactivePrimitives.md
+89 −0 Documentation/RxComparison.md
+ Logo/Icons/docset-icon.png
+ Logo/Icons/[email protected]
+24 −0 Package.pins
+34 −0 Package.resolved
+18 −3 Package.swift
+54 −371 README.md
+44 −20 ReactiveSwift-UIExamples.playground/Pages/ValidatingProperty.xcplaygroundpage/Contents.swift
+2 −2 ReactiveSwift-UIExamples.playground/Pages/ValidatingProperty.xcplaygroundpage/Sources/UIKitExtensions.swift
+5 −5 ReactiveSwift.playground/Pages/Property.xcplaygroundpage/Contents.swift
+12 −12 ReactiveSwift.playground/Pages/Signal.xcplaygroundpage/Contents.swift
+7 −7 ReactiveSwift.playground/Pages/SignalProducer.xcplaygroundpage/Contents.swift
+1 −1 ReactiveSwift.playground/contents.xcplayground
+1 −1 ReactiveSwift.podspec
+11 −51 ReactiveSwift.xcodeproj/project.pbxproj
+226 −212 Sources/Action.swift
+110 −121 Sources/Atomic.swift
+52 −58 Sources/Bag.swift
+124 −567 Sources/Deprecations+Removals.swift
+140 −187 Sources/Disposable.swift
+119 −115 Sources/Event.swift
+13 −13 Sources/EventLogger.swift
+381 −568 Sources/Flatten.swift
+53 −25 Sources/FoundationExtensions.swift
+1 −1 Sources/Info.plist
+132 −0 Sources/InhabitableTypeGuards.swift
+50 −33 Sources/Lifetime.swift
+102 −85 Sources/Observer.swift
+2 −2 Sources/Optional.swift
+239 −190 Sources/Property.swift
+33 −26 Sources/Scheduler.swift
+1,039 −819 Sources/Signal.swift
+857 −742 Sources/SignalProducer.swift
+0 −42 Sources/TupleExtensions.swift
+115 −116 Sources/UnidirectionalBinding.swift
+66 −66 Sources/ValidatingProperty.swift
+113 −26 Tests/ReactiveSwiftTests/ActionSpec.swift
+1 −28 Tests/ReactiveSwiftTests/DeprecationSpec.swift
+11 −11 Tests/ReactiveSwiftTests/DisposableSpec.swift
+63 −11 Tests/ReactiveSwiftTests/FlattenSpec.swift
+15 −9 Tests/ReactiveSwiftTests/FoundationExtensionsSpec.swift
+1 −1 Tests/ReactiveSwiftTests/Info.plist
+54 −35 Tests/ReactiveSwiftTests/PropertySpec.swift
+118 −46 Tests/ReactiveSwiftTests/SignalLifetimeSpec.swift
+104 −21 Tests/ReactiveSwiftTests/SignalProducerLiftingSpec.swift
+1 −1 Tests/ReactiveSwiftTests/SignalProducerNimbleMatchers.swift
+333 −96 Tests/ReactiveSwiftTests/SignalProducerSpec.swift
+319 −41 Tests/ReactiveSwiftTests/SignalSpec.swift
+2 −2 Tests/ReactiveSwiftTests/TestError.swift
+88 −38 Tests/ReactiveSwiftTests/UnidirectionalBindingSpec.swift
+1 −1 Tests/ReactiveSwiftTests/ValidatingPropertySpec.swift
+1 −1 script/build
+4 −0 script/feed.xml.template
+33 −8 script/gen-docs
+24 −0 script/update-version
32 changes: 17 additions & 15 deletions ReactiveObjCBridge/ObjectiveCBridging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import ReactiveObjC
import ReactiveSwift
import Result

extension SignalProtocol {
extension Signal {
/// Turns each value into an Optional.
fileprivate func optionalize() -> Signal<Value?, Error> {
return map(Optional.init)
}
}

extension SignalProducerProtocol {
extension SignalProducer {
/// Turns each value into an Optional.
fileprivate func optionalize() -> SignalProducer<Value?, Error> {
return lift { $0.optionalize() }
Expand Down Expand Up @@ -206,7 +206,7 @@ public func bridgedSignalProducer<First, Second, Third, Fourth, Fifth>(from sign
return _bridgedSignalProducer(from: signal, file: file, line: line).map { $0.map(bridgedTuple) }
}

extension SignalProducerProtocol where Value: AnyObject {
extension SignalProducer where Value: AnyObject {
/// Create a `RACSignal` that will `start()` the producer once for each
/// subscription.
///
Expand Down Expand Up @@ -235,7 +235,7 @@ extension SignalProducerProtocol where Value: AnyObject {
}
}

extension SignalProducerProtocol where Value: OptionalProtocol, Value.Wrapped: AnyObject {
extension SignalProducer where Value: OptionalProtocol, Value.Wrapped: AnyObject {
/// Create a `RACSignal` that will `start()` the producer once for each
/// subscription.
///
Expand Down Expand Up @@ -267,7 +267,7 @@ extension SignalProducerProtocol where Value: OptionalProtocol, Value.Wrapped: A
}
}

extension SignalProtocol where Value: AnyObject {
extension Signal where Value: AnyObject {
/// Create a `RACSignal` that will observe the given signal.
///
/// - note: Any `interrupted` events will be silently discarded.
Expand Down Expand Up @@ -295,7 +295,7 @@ extension SignalProtocol where Value: AnyObject {
}
}

extension SignalProtocol where Value: OptionalProtocol, Value.Wrapped: AnyObject {
extension Signal where Value: OptionalProtocol, Value.Wrapped: AnyObject {
/// Create a `RACSignal` that will observe the given signal.
///
/// - note: Any `interrupted` events will be silently discarded.
Expand Down Expand Up @@ -328,7 +328,7 @@ extension SignalProtocol where Value: OptionalProtocol, Value.Wrapped: AnyObject

// MARK: -

extension ActionProtocol {
extension Action {
fileprivate var isCommandEnabled: RACSignal<NSNumber> {
return self.isEnabled.producer
.map { $0 as NSNumber }
Expand Down Expand Up @@ -363,7 +363,7 @@ public func bridgedAction<Input, Output>(from command: RACCommand<Input, Output>
}
}

extension ActionProtocol where Input: AnyObject, Output: AnyObject {
extension Action where Input: AnyObject, Output: AnyObject {
/// Creates a RACCommand that will execute the action.
///
/// - note: The returned command will not necessarily be marked as executing
Expand All @@ -372,14 +372,14 @@ extension ActionProtocol where Input: AnyObject, Output: AnyObject {
///
/// - returns: `RACCommand` with bound action.
public func toRACCommand() -> RACCommand<Input, Output> {
return RACCommand<Input, Output>(enabled: action.isCommandEnabled) { input -> RACSignal<Output> in
return RACCommand<Input, Output>(enabled: self.isCommandEnabled) { input -> RACSignal<Output> in
return self.apply(input!)
.toRACSignal()
}
}
}

extension ActionProtocol where Input: OptionalProtocol, Input.Wrapped: AnyObject, Output: AnyObject {
extension Action where Input: OptionalProtocol, Input.Wrapped: AnyObject, Output: AnyObject {
/// Creates a RACCommand that will execute the action.
///
/// - note: The returned command will not necessarily be marked as executing
Expand All @@ -388,15 +388,15 @@ extension ActionProtocol where Input: OptionalProtocol, Input.Wrapped: AnyObject
///
/// - returns: `RACCommand` with bound action.
public func toRACCommand() -> RACCommand<Input.Wrapped, Output> {
return RACCommand<Input.Wrapped, Output>(enabled: action.isCommandEnabled) { input -> RACSignal<Output> in
return RACCommand<Input.Wrapped, Output>(enabled: self.isCommandEnabled) { input -> RACSignal<Output> in
return self
.apply(Input(reconstructing: input))
.toRACSignal()
}
}
}

extension ActionProtocol where Input: AnyObject, Output: OptionalProtocol, Output.Wrapped: AnyObject {
extension Action where Input: AnyObject, Output: OptionalProtocol, Output.Wrapped: AnyObject {
/// Creates a RACCommand that will execute the action.
///
/// - note: The returned command will not necessarily be marked as executing
Expand All @@ -405,15 +405,15 @@ extension ActionProtocol where Input: AnyObject, Output: OptionalProtocol, Outpu
///
/// - returns: `RACCommand` with bound action.
public func toRACCommand() -> RACCommand<Input, Output.Wrapped> {
return RACCommand<Input, Output.Wrapped>(enabled: action.isCommandEnabled) { input -> RACSignal<Output.Wrapped> in
return RACCommand<Input, Output.Wrapped>(enabled: self.isCommandEnabled) { input -> RACSignal<Output.Wrapped> in
return self
.apply(input!)
.toRACSignal()
}
}
}

extension ActionProtocol where Input: OptionalProtocol, Input.Wrapped: AnyObject, Output: OptionalProtocol, Output.Wrapped: AnyObject {
extension Action where Input: OptionalProtocol, Input.Wrapped: AnyObject, Output: OptionalProtocol, Output.Wrapped: AnyObject {
/// Creates a RACCommand that will execute the action.
///
/// - note: The returned command will not necessarily be marked as executing
Expand All @@ -422,7 +422,7 @@ extension ActionProtocol where Input: OptionalProtocol, Input.Wrapped: AnyObject
///
/// - returns: `RACCommand` with bound action.
public func toRACCommand() -> RACCommand<Input.Wrapped, Output.Wrapped> {
return RACCommand<Input.Wrapped, Output.Wrapped>(enabled: action.isCommandEnabled) { input -> RACSignal<Output.Wrapped> in
return RACCommand<Input.Wrapped, Output.Wrapped>(enabled: self.isCommandEnabled) { input -> RACSignal<Output.Wrapped> in
return self
.apply(Input(reconstructing: input))
.toRACSignal()
Expand Down Expand Up @@ -495,6 +495,8 @@ extension DispatchTimeInterval {
return TimeInterval(UInt64(us) * NSEC_PER_USEC) / TimeInterval(NSEC_PER_SEC)
case let .nanoseconds(ns):
return TimeInterval(ns) / TimeInterval(NSEC_PER_SEC)
case let .never:
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be conditionally compiled (just like we did in ReactiveSwift) to maintain compatibility with Xcode 8.2/Swift 3.1.

return .infinity
}
}
}