Skip to content

Commit

Permalink
Merge pull request #37 from YuAo/master
Browse files Browse the repository at this point in the history
Make SwiftCoroutine compatible with `async/await` in Swift 5.5
  • Loading branch information
belozierov authored Jun 9, 2021
2 parents 9c395df + 7235e38 commit d15c034
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sources/SwiftCoroutine/CoFuture/Core/CoFuture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2020 Alex Belozierov. All rights reserved.
//

private protocol _CoFutureCancellable: class {
private protocol _CoFutureCancellable: AnyObject {

func cancel()

Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftCoroutine/CoScope/CoCancellable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2020 Alex Belozierov. All rights reserved.
//

public protocol CoCancellable: class {
public protocol CoCancellable: AnyObject {

/// Cancels the current `CoCancellable`.
func cancel()
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftCoroutine/Coroutine/Coroutine/Coroutine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public struct Coroutine {
timer.schedule(deadline: .now() + time)
defer { timer.cancel() }
do {
try await {
try self.await {
timer.setEventHandler(handler: $0)
timer.start()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Glibc
import Darwin
#endif

@usableFromInline internal protocol CoroutineProtocol: class {
@usableFromInline internal protocol CoroutineProtocol: AnyObject {

typealias StackSize = Coroutine.StackSize

Expand Down

0 comments on commit d15c034

Please sign in to comment.