Skip to content

Commit

Permalink
Fix Swift 4.2 compatibility on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesyo committed Jan 15, 2019
1 parent 8a5e6b8 commit 9d98576
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/Nimble/Matchers/BeIdenticalTo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation
/// as the expected instance.
public func beIdenticalTo(_ expected: Any?) -> Predicate<Any> {
return Predicate.define { actualExpression in
#if os(Linux)
#if os(Linux) && !swift(>=4.1.50)
let actual = try actualExpression.evaluate() as? AnyObject
#else
let actual = try actualExpression.evaluate() as AnyObject?
Expand Down
2 changes: 1 addition & 1 deletion Sources/Nimble/Utils/Await.swift
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ internal class AwaitPromiseBuilder<T> {
self.trigger.timeoutSource.resume()
while self.promise.asyncResult.isIncomplete() {
// Stopping the run loop does not work unless we run only 1 mode
#if swift(>=4.2)
#if swift(>=4.2) && (os(macOS) || os(iOS) || os(tvOS))
_ = RunLoop.current.run(mode: .default, before: .distantFuture)
#else
_ = RunLoop.current.run(mode: .defaultRunLoopMode, before: .distantFuture)
Expand Down

0 comments on commit 9d98576

Please sign in to comment.